1 #ifndef HeterogeneousCore_CUDACore_src_getCachingDeviceAllocator
2 #define HeterogeneousCore_CUDACore_src_getCachingDeviceAllocator
33 size_t freeMemory, totalMemory;
35 cudaCheck(cudaMemGetInfo(&freeMemory, &totalMemory));
46 LogDebug(
"CachingDeviceAllocator").log([](
auto&
log) {
47 log <<
"cub::CachingDeviceAllocator settings\n"
49 <<
" min bin " <<
minBin <<
"\n"
50 <<
" max bin " <<
maxBin <<
"\n"
51 <<
" resulting bins:\n";
54 if (binSize >= (1 << 30) and binSize % (1 << 30) == 0) {
55 log <<
" " << std::setw(8) << (binSize >> 30) <<
" GB\n";
56 }
else if (binSize >= (1 << 20) and binSize % (1 << 20) == 0) {
57 log <<
" " << std::setw(8) << (binSize >> 20) <<
" MB\n";
58 }
else if (binSize >= (1 << 10) and binSize % (1 << 10) == 0) {
59 log <<
" " << std::setw(8) << (binSize >> 10) <<
" kB\n";
61 log <<
" " << std::setw(9) << binSize <<
" B\n";
64 log <<
" maximum amount of cached memory: " << (
minCachedBytes() >> 20) <<
" MB\n";