From d345b2164b8f7d576e8cb4c4c3fcc37afbc78baa Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 21 May 2018 20:02:17 -0400 Subject: [PATCH] P4 to Git Change 1557352 by cpaquot@cpaquot-ocl-lc-lnx on 2018/05/21 19:53:00 SWDEV-145570 - [HIP] Sync streams in hipFree. hipTestHalf passes now. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#27 edit [ROCm/hip commit: f165295c66081f057f10beee909c9aabc87e1487] --- projects/hip/api/hip/hip_memory.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/hip/api/hip/hip_memory.cpp b/projects/hip/api/hip/hip_memory.cpp index 05fcfbe21a..ebe630924b 100644 --- a/projects/hip/api/hip/hip_memory.cpp +++ b/projects/hip/api/hip/hip_memory.cpp @@ -186,6 +186,8 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) { hipError_t hipFree(void* ptr) { if (amd::SvmBuffer::malloced(ptr)) { + hip::syncStreams(); + hip::getNullStream()->finish(); amd::SvmBuffer::free(*hip::getCurrentContext(), ptr); return hipSuccess; }