Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-15 01:07:42

0001 #ifndef HeterogeneousCore_AlpakaInterface_interface_AllocatorConfig_h
0002 #define HeterogeneousCore_AlpakaInterface_interface_AllocatorConfig_h
0003 
0004 #include <limits>
0005 
0006 namespace cms::alpakatools {
0007 
0008   namespace config {
0009 
0010     // bin growth factor (bin_growth in cub::CachingDeviceAllocator)
0011     constexpr unsigned int binGrowth = 2;
0012 
0013     // smallest bin, corresponds to binGrowth^minBin bytes (min_bin in cub::CachingDeviceAllocator
0014     constexpr unsigned int minBin = 8;  // 256 bytes
0015 
0016     // largest bin, corresponds to binGrowth^maxBin bytes (max_bin in cub::CachingDeviceAllocator). Note that unlike in cub, allocations larger than binGrowth^maxBin are set to fail.
0017     constexpr unsigned int maxBin = 30;  // 1 GB
0018 
0019     // total storage for the allocator; 0 means no limit.
0020     constexpr size_t maxCachedBytes = 0;
0021 
0022     // fraction of total device memory taken for the allocator; 0 means no limit.
0023     constexpr double maxCachedFraction = 0.8;
0024 
0025     // if both maxCachedBytes and maxCachedFraction are non-zero, the smallest resulting value is used.
0026 
0027   }  // namespace config
0028 
0029 }  // namespace cms::alpakatools
0030 
0031 #endif  // HeterogeneousCore_AlpakaInterface_interface_AllocatorConfig_h