Skip to content

Commit 2ab09de

Browse files
committed
Roll GPGMM
* Depreciate ResidencySet with ResidencyList. * Depreciate Heap::As with ComPtr:As.
1 parent 525a858 commit 2ab09de

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
@@ -19,7 +19,7 @@ SVDescriptorHeap::SVDescriptorHeap(
1919

2020
ID3D12DescriptorHeap* SVDescriptorHeap::GetDescriptorHeap() const {
2121
ComPtr<ID3D12DescriptorHeap> descriptorHeap;
22-
m_Heap->As(&descriptorHeap);
22+
m_Heap.As(&descriptorHeap);
2323
return descriptorHeap.Get();
2424
}
2525

@@ -574,8 +574,8 @@ HRESULT Device::ExecuteCommandListAndWait()
574574

575575
ID3D12CommandList* commandLists[] = { m_commandList.Get() };
576576
if (m_residencyManager != nullptr){
577-
gpgmm::d3d12::ResidencySet* residencySets[] = { &m_residencySet };
578-
m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencySets, ARRAYSIZE(commandLists));
577+
gpgmm::d3d12::ResidencyList* residencyLists[] = { &m_residencyList };
578+
m_residencyManager->ExecuteCommandLists(m_commandQueue.Get(), commandLists, residencyLists, ARRAYSIZE(commandLists));
579579
} else {
580580
m_commandQueue->ExecuteCommandLists(ARRAYSIZE(commandLists), commandLists);
581581
}
@@ -584,7 +584,7 @@ HRESULT Device::ExecuteCommandListAndWait()
584584

585585
ReturnIfFailed(m_commandAllocator->Reset());
586586
ReturnIfFailed(m_commandList->Reset(m_commandAllocator.Get(), nullptr));
587-
ReturnIfFailed(m_residencySet.Reset());
587+
ReturnIfFailed(m_residencyList.Reset());
588588
return S_OK;
589589
}
590590

@@ -633,7 +633,7 @@ HRESULT Device::EnsureCpuBufferSize(uint64_t requestedSizeInBytes, _Inout_ ComPt
633633
ReturnIfFailed(CreateCpuCustomBuffer(m_resourceAllocator.Get(), newSize, buffer));
634634
}
635635

636-
UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet);
636+
UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList);
637637

638638
return S_OK;
639639
}
@@ -650,7 +650,7 @@ HRESULT Device::EnsureDefaultBufferSize(uint64_t requestedSizeInBytes, _Inout_ C
650650
ReturnIfFailed(CreateDefaultBuffer(m_resourceAllocator.Get(), newSize, buffer));
651651
}
652652

653-
UpdateResidencyIfNeeded(buffer.Get(), &m_residencySet);
653+
UpdateResidencyIfNeeded(buffer.Get(), &m_residencyList);
654654

655655
return S_OK;
656656
}
@@ -709,7 +709,7 @@ HRESULT Device::EnsureReadBackHeapSize(uint64_t requestedSizeInBytes)
709709
ReturnIfFailed(CreateReadBackBuffer(m_resourceAllocator.Get(), newSize, m_readbackHeap));
710710
}
711711

712-
UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencySet);
712+
UpdateResidencyIfNeeded(m_readbackHeap.Get(), &m_residencyList);
713713

714714
return S_OK;
715715
}

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)