SWDEV-482130 - Fix release of virtual mem obj

Change-Id: I893a8353aa1a25d00e36c8e601caf31cc0fc1f22


[ROCm/clr commit: 43fcac1739]
このコミットが含まれているのは:
Branislav Brzak authored and Anusha Godavarthy Surya committed 2024-10-08 01:37:39 -04:00
1 親 57c5264937
コミット 491d3828dd
3ファイル変更
+24 -9

検索条件に一致するファイルはありません

+7 -1
ファイルの表示
@@ -95,8 +95,14 @@ bool Heap::RemoveMemory(amd::Memory* memory, MemoryTimestamp* ts) {
Heap::SortedMap::iterator Heap::EraseAllocaton(Heap::SortedMap::iterator& it) {
auto memory = it->first.second;
const device::Memory* dev_mem = memory->getDeviceMemory(*device_->devices()[0]);
void* dev_mem_vaddr = reinterpret_cast<void*>(dev_mem->virtualAddress());
total_size_ -= it->first.first;
amd::SvmBuffer::free(memory->getContext(), reinterpret_cast<void*>(dev_mem->virtualAddress()));
if (dev_mem_vaddr != nullptr) {
amd::SvmBuffer::free(memory->getContext(), dev_mem_vaddr);
} else {
amd::SvmBuffer::free(memory->getContext(), memory->getSvmPtr());
}
// Clear HIP event
it->second.SetEvent(nullptr);
// Remove the allocation from the map