SWDEV-482130 - Fix release of virtual mem obj
Change-Id: I893a8353aa1a25d00e36c8e601caf31cc0fc1f22
Tá an tiomantas seo le fáil i:
tiomanta ag
Anusha Godavarthy Surya
tuismitheoir
522ae8ead4
tiomantas
43fcac1739
@@ -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
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir