Skip to content

Commit 294de6b

Browse files
authored
Merge pull request #289 from bbernhar/roll_gpgmm
Roll GPGMM
2 parents c826c65 + 2ab09de commit 294de6b

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ deps = {
5555
},
5656
# GPGMM support for fast DML allocation and residency management.
5757
'third_party/gpgmm': {
58-
'url': '{github_git}/intel/gpgmm.git@61fcfcbd872b7643423ac8c9555f3a6a366904ee',
58+
'url': '{github_git}/intel/gpgmm.git@ff03c9a0cea262e534d25257512f2ba2bdb8c2d4',
5959
'condition': 'checkout_win',
6060
},
6161
'third_party/oneDNN': {

src/webnn/native/dmlx/deps/src/device.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SVDescriptorHeap::SVDescriptorHeap(
2121

2222
ID3D12DescriptorHeap* SVDescriptorHeap::GetDescriptorHeap() const {
2323
ComPtr<ID3D12DescriptorHeap> descriptorHeap;
24-
m_Heap->As(&descriptorHeap);
24+
m_Heap.As(&descriptorHeap);
2525
return descriptorHeap.Get();
2626
}
2727

@@ -584,8 +584,8 @@ HRESULT Device::ExecuteCommandListAndWait()
584584

585585
ID3D12CommandList* commandLists[] = { m_commandList.Get() };
586586
if (m_residencyManager != nullptr){
587-
gpgmm::d3d12::ResidencySet* residencySets[] = { &m_residencySet };
588-
m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencySets, ARRAYSIZE(commandLists));
587+
gpgmm::d3d12::ResidencyList* residencyLists[] = { &m_residencyList };
588+
m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencyLists, ARRAYSIZE(commandLists));
589589
} else {
590590
m_commandQueue->ExecuteCommandLists(ARRAYSIZE(commandLists), commandLists);
591591
}
@@ -594,7 +594,7 @@ HRESULT Device::ExecuteCommandListAndWait()
594594

595595
ReturnIfFailed(m_commandAllocator->Reset());
596596
ReturnIfFailed(m_commandList->Reset(m_commandAllocator.Get(), nullptr));
597-
ReturnIfFailed(m_residencySet.Reset());
597+
ReturnIfFailed(m_residencyList.Reset());
598598
return S_OK;
599599
}
600600

@@ -643,7 +643,7 @@ HRESULT Device::EnsureCpuBufferSize(uint64_t requestedSizeInBytes, _Inout_ ComPt
643643
ReturnIfFailed(CreateCpuCustomBuffer(m_resourceAllocator.Get(), newSize, buffer));
644644
}
645645

646-
UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet);
646+
UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList);
647647

648648
return S_OK;
649649
}
@@ -660,7 +660,7 @@ HRESULT Device::EnsureDefaultBufferSize(uint64_t requestedSizeInBytes, _Inout_ C
660660
ReturnIfFailed(CreateDefaultBuffer(m_resourceAllocator.Get(), newSize, buffer));
661661
}
662662

663-
UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet);
663+
UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList);
664664

665665
return S_OK;
666666
}
@@ -719,7 +719,7 @@ HRESULT Device::EnsureReadBackHeapSize(uint64_t requestedSizeInBytes)
719719
ReturnIfFailed(CreateReadBackBuffer(m_resourceAllocator.Get(), newSize, m_readbackHeap));
720720
}
721721

722-
UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencySet);
722+
UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencyList);
723723

724724
return S_OK;
725725
}

src/webnn/native/dmlx/deps/src/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace pydml
9898
Microsoft::WRL::ComPtr<gpgmm::d3d12::ResourceAllocation> m_temporaryResource;
9999
Microsoft::WRL::ComPtr<gpgmm::d3d12::ResourceAllocation> m_persistentResource;
100100

101-
gpgmm::d3d12::ResidencySet m_residencySet;
101+
gpgmm::d3d12::ResidencyList m_residencyList;
102102

103103
bool m_useCpuCustomHeapResources = false;
104104
bool m_useGpu = true;

src/webnn/native/dmlx/deps/src/util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ struct DmlBufferArrayBinding
116116
}
117117
};
118118

119-
inline void UpdateResidencyIfNeeded(gpgmm::d3d12::ResourceAllocation* resource, gpgmm::d3d12::ResidencySet* residencySet){
119+
inline void UpdateResidencyIfNeeded(gpgmm::d3d12::ResourceAllocation* resource, gpgmm::d3d12::ResidencyList* residencyList){
120120
if (resource == nullptr) return;
121-
residencySet->Insert(resource->GetMemory());
121+
residencyList->Add(resource->GetMemory());
122122
}
123123

124124
inline HRESULT CreateResource(

0 commit comments

Comments
 (0)