SWDEV-451736 - Revert "SWDEV-444670 - Register the Runtime::tearDown function to be called at exit"
This reverts commit8392200773. Change-Id: Ib9cb1cc0c3903bfba56c9a5d05ae8afe96be583a [ROCm/clr commit:51926b6b6b]
This commit is contained in:
@@ -615,7 +615,7 @@ Buffer::Buffer(const roc::Device& dev, size_t size) : roc::Memory(dev, size) {}
|
||||
|
||||
Buffer::~Buffer() {
|
||||
if (owner() == nullptr) {
|
||||
dev().memFree(deviceMemory_, size());
|
||||
dev().hostFree(deviceMemory_, size());
|
||||
} else {
|
||||
destroy();
|
||||
|
||||
@@ -663,7 +663,7 @@ void Buffer::destroy() {
|
||||
ClPrint(amd::LOG_DEBUG, amd::LOG_MEM, "[ROCClr] munmap failed \n");
|
||||
}
|
||||
} else {
|
||||
dev().memFree(deviceMemory_, size());
|
||||
dev().hostFree(deviceMemory_, size());
|
||||
}
|
||||
} else if (memFlags & ROCCLR_MEM_HSA_SIGNAL_MEMORY) {
|
||||
if (HSA_STATUS_SUCCESS != hsa_signal_destroy(signal_)) {
|
||||
@@ -672,7 +672,7 @@ void Buffer::destroy() {
|
||||
}
|
||||
deviceMemory_ = nullptr;
|
||||
} else {
|
||||
dev().memFree(deviceMemory_, size());
|
||||
dev().hostFree(deviceMemory_, size());
|
||||
}
|
||||
} else {
|
||||
dev().memFree(deviceMemory_, size());
|
||||
|
||||
@@ -120,12 +120,4 @@ uint ReferenceCountedObject::release() {
|
||||
return newCount;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
void __attribute__((destructor)) hipTearDown() {
|
||||
if (amd::IS_HIP) {
|
||||
Runtime::tearDown();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace amd
|
||||
|
||||
Reference in New Issue
Block a user