SWDEV-445576 - Return error when hipMemPoolDestroy is invoked on the default mempool

Change-Id: I7a7ab499f781cf7e92cad1ae39a40b4f37f62653


[ROCm/clr commit: 4d61237a6f]
Этот коммит содержится в:
Ioannis Assiouras
2024-02-12 12:48:21 +00:00
родитель fb39e68de7
Коммит eb5d8d2647
+4 -1
Просмотреть файл
@@ -252,9 +252,12 @@ hipError_t hipMemPoolDestroy(hipMemPool_t mem_pool) {
HIP_RETURN(hipErrorInvalidValue);
}
hip::MemoryPool* hip_mem_pool = reinterpret_cast<hip::MemoryPool*>(mem_pool);
hip_mem_pool->ReleaseFreedMemory();
auto device = hip_mem_pool->Device();
if (hip_mem_pool == device->GetDefaultMemoryPool()) {
HIP_RETURN(hipErrorInvalidValue);
}
hip_mem_pool->ReleaseFreedMemory();
// Force default pool if the current one is destroyed
if (hip_mem_pool == device->GetCurrentMemoryPool()) {