minor changes
This commit is contained in:
parent
f7e652ca63
commit
78eb2ed9b3
@ -47,6 +47,7 @@ hypre_WrongMemoryLocation()
|
|||||||
void
|
void
|
||||||
hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location)
|
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 defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) || defined(HYPRE_USING_SYCL)
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
{
|
{
|
||||||
@ -59,6 +60,7 @@ hypre_CheckMemoryLocation(void *ptr, hypre_MemoryLocation location)
|
|||||||
* will create an endless loop otherwise */
|
* will create an endless loop otherwise */
|
||||||
assert(location == location_ptr);
|
assert(location == location_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================================================
|
/*==========================================================================
|
||||||
@ -145,9 +147,7 @@ hypre_UnifiedMemPrefetch(void *ptr, size_t size, hypre_MemoryLocation location)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HYPRE_DEBUG)
|
|
||||||
hypre_CheckMemoryLocation(ptr, hypre_MEMORY_UNIFIED);
|
hypre_CheckMemoryLocation(ptr, hypre_MEMORY_UNIFIED);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HYPRE_USING_CUDA)
|
#if defined(HYPRE_USING_CUDA)
|
||||||
if (location == hypre_MEMORY_DEVICE)
|
if (location == hypre_MEMORY_DEVICE)
|
||||||
@ -519,9 +519,7 @@ hypre_Free_core(void *ptr, hypre_MemoryLocation location)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HYPRE_DEBUG)
|
|
||||||
hypre_CheckMemoryLocation(ptr, location);
|
hypre_CheckMemoryLocation(ptr, location);
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (location)
|
switch (location)
|
||||||
{
|
{
|
||||||
@ -576,13 +574,11 @@ hypre_Memcpy_core(void *dst, void *src, size_t size, hypre_MemoryLocation loc_ds
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HYPRE_DEBUG)
|
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
{
|
{
|
||||||
hypre_CheckMemoryLocation(dst, loc_dst);
|
hypre_CheckMemoryLocation(dst, loc_dst);
|
||||||
hypre_CheckMemoryLocation(src, loc_src);
|
hypre_CheckMemoryLocation(src, loc_src);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Totally 4 x 4 = 16 cases */
|
/* 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;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HYPRE_DEBUG)
|
|
||||||
hypre_CheckMemoryLocation(ptr, hypre_GetActualMemLocation(location));
|
hypre_CheckMemoryLocation(ptr, hypre_GetActualMemLocation(location));
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (hypre_GetActualMemLocation(location))
|
switch (hypre_GetActualMemLocation(location))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user