From 2e9b8e9d0de392b673a02fe6a18b1fe386857a79 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Fri, 13 Sep 2019 02:10:21 +0530 Subject: [PATCH 1/2] [HACK] Temporary fix for hipFree for hipManagedMalloc --- hipamd/src/hip_memory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 2deedbc635..c249c08d63 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -1989,7 +1989,8 @@ hipError_t hipFree(void* ptr) { #endif am_status_t status = hc::am_memtracker_getinfo(&amPointerInfo, ptr); if (status == AM_SUCCESS) { - if (amPointerInfo._hostPointer == NULL) { + /*if (amPointerInfo._hostPointer == NULL) */ //TODO Fix this when there is proper Managed memeory support + { if (HIP_SYNC_FREE) { // Synchronize all devices, all streams // to ensure all work has finished on all devices. From d9179cbe705e9d9becdd60002eb8c8e4ca93e471 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Fri, 13 Sep 2019 03:09:01 +0530 Subject: [PATCH 2/2] Fix typo and colon in comment --- hipamd/src/hip_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index c249c08d63..f3c01491e5 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -1989,7 +1989,7 @@ hipError_t hipFree(void* ptr) { #endif am_status_t status = hc::am_memtracker_getinfo(&amPointerInfo, ptr); if (status == AM_SUCCESS) { - /*if (amPointerInfo._hostPointer == NULL) */ //TODO Fix this when there is proper Managed memeory support + /*if (amPointerInfo._hostPointer == NULL) */ //TODO: Fix it when there is proper managed memory support { if (HIP_SYNC_FREE) { // Synchronize all devices, all streams