From c5c2dbc0cef01817a4442093dc94e440f7193e09 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Tue, 2 Jun 2020 14:21:49 -0400 Subject: [PATCH] Optional CUDA info --- Grid/allocator/AlignedAllocator.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Grid/allocator/AlignedAllocator.h b/Grid/allocator/AlignedAllocator.h index 77167299..2976aed7 100644 --- a/Grid/allocator/AlignedAllocator.h +++ b/Grid/allocator/AlignedAllocator.h @@ -92,6 +92,13 @@ public: static bool debug; }; +#ifdef GRID_NVCC +#define profilerCudaMeminfo \ + { size_t f, t ; cudaMemGetInfo ( &f,&t); std::cout << GridLogDebug << "[Memory debug] Cuda free "<totalFreed) \ << std::endl; \ - } + } \ + profilerCudaMeminfo; #define profilerAllocate(bytes) \ if (MemoryProfiler::stats) \