From 78eb2ed9b3d74b777f138eba05f31d2211b00080 Mon Sep 17 00:00:00 2001 From: Ruipeng Li Date: Thu, 9 Jun 2022 15:16:03 -0700 Subject: [PATCH] minor changes --- src/utilities/memory.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/utilities/memory.c b/src/utilities/memory.c index 81e8883ff..bd54868bc 100644 --- a/src/utilities/memory.c +++ b/src/utilities/memory.c @@ -47,6 +47,7 @@ hypre_WrongMemoryLocation() void hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location) { +#if defined(HYPRE_DEBUG) #if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) || defined(HYPRE_USING_SYCL) if (!ptr) { @@ -59,6 +60,7 @@ hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location) * will create an endless loop otherwise */ assert(location == location_ptr); #endif +#endif } /*========================================================================== @@ -145,9 +147,7 @@ hypre_UnifiedMemPrefetch(void *ptr, size_t size, hypre_MemoryLocation location) return; } -#if defined(HYPRE_DEBUG) hypre_CheckMemoryLocation(ptr, hypre_MEMORY_UNIFIED); -#endif #if defined(HYPRE_USING_CUDA) if (location == hypre_MEMORY_DEVICE) @@ -519,9 +519,7 @@ hypre_Free_core(void *ptr, hypre_MemoryLocation location) return; } -#if defined(HYPRE_DEBUG) hypre_CheckMemoryLocation(ptr, location); -#endif switch (location) { @@ -576,13 +574,11 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds return; } -#if defined(HYPRE_DEBUG) if (size > 0) { hypre_CheckMemoryLocation(dst, loc_dst); hypre_CheckMemoryLocation(src, loc_src); } -#endif /* Totally 4 x 4 = 16 cases */ @@ -863,9 +859,7 @@ hypre_Memset(void *ptr, HYPRE_Int value, size_t num, HYPRE_MemoryLocation locati return ptr; } -#if defined(HYPRE_DEBUG) hypre_CheckMemoryLocation(ptr, hypre_GetActualMemLocation(location)); -#endif switch (hypre_GetActualMemLocation(location)) {