diff --git a/hipamd/api/hip/hip_memory.cpp b/hipamd/api/hip/hip_memory.cpp index 424fbec633..98c4c50e03 100644 --- a/hipamd/api/hip/hip_memory.cpp +++ b/hipamd/api/hip/hip_memory.cpp @@ -540,6 +540,9 @@ hipError_t hipHostUnregister(void* hostPtr) { amd::Memory* mem = getMemoryObject(hostPtr, offset); if(mem) { + hip::syncStreams(); + hip::getNullStream()->finish(); + amd::MemObjMap::RemoveMemObj(hostPtr); mem->release(); return hipSuccess; }