mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Optional CUDA info
This commit is contained in:
parent
5aa60be17d
commit
c5c2dbc0ce
@ -92,6 +92,13 @@ public:
|
|||||||
static bool debug;
|
static bool debug;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef GRID_NVCC
|
||||||
|
#define profilerCudaMeminfo \
|
||||||
|
{ size_t f, t ; cudaMemGetInfo ( &f,&t); std::cout << GridLogDebug << "[Memory debug] Cuda free "<<f<<"/"<<t << std::endl;}
|
||||||
|
#else
|
||||||
|
#define profilerCudaMeminfo
|
||||||
|
#endif
|
||||||
|
|
||||||
#define memString(bytes) std::to_string(bytes) + " (" + sizeString(bytes) + ")"
|
#define memString(bytes) std::to_string(bytes) + " (" + sizeString(bytes) + ")"
|
||||||
#define profilerDebugPrint \
|
#define profilerDebugPrint \
|
||||||
if (MemoryProfiler::stats) \
|
if (MemoryProfiler::stats) \
|
||||||
@ -106,7 +113,8 @@ public:
|
|||||||
<< std::endl; \
|
<< std::endl; \
|
||||||
std::cout << GridLogDebug << "[Memory debug] freed : " << memString(s->totalFreed) \
|
std::cout << GridLogDebug << "[Memory debug] freed : " << memString(s->totalFreed) \
|
||||||
<< std::endl; \
|
<< std::endl; \
|
||||||
}
|
} \
|
||||||
|
profilerCudaMeminfo;
|
||||||
|
|
||||||
#define profilerAllocate(bytes) \
|
#define profilerAllocate(bytes) \
|
||||||
if (MemoryProfiler::stats) \
|
if (MemoryProfiler::stats) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user