From 8c913e0edd7c00fa98fec77b4fb01e75b84db268 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 3 Sep 2020 21:59:05 -0400 Subject: [PATCH] Clearer UVM ttreatment --- Grid/allocator/AlignedAllocator.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Grid/allocator/AlignedAllocator.h b/Grid/allocator/AlignedAllocator.h index ebb3162b..3eb2c6d8 100644 --- a/Grid/allocator/AlignedAllocator.h +++ b/Grid/allocator/AlignedAllocator.h @@ -53,7 +53,11 @@ public: { size_type bytes = __n*sizeof(_Tp); profilerAllocate(bytes); +#ifdef GRID_UVM + _Tp *ptr = (_Tp*) MemoryManager::SharedAllocate(bytes); +#else _Tp *ptr = (_Tp*) MemoryManager::CpuAllocate(bytes); +#endif assert( ( (_Tp*)ptr != (_Tp *)NULL ) ); return ptr; } @@ -62,7 +66,11 @@ public: { size_type bytes = __n * sizeof(_Tp); profilerFree(bytes); +#ifdef GRID_UVM + MemoryManager::SharedFree((void *)__p,bytes); +#else MemoryManager::CpuFree((void *)__p,bytes); +#endif } // FIXME: hack for the copy constructor, eventually it must be avoided