Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:05:46

0001 #ifndef HeterogeneousCore_CUDAUtilities_deviceAllocatorStatus_h
0002 #define HeterogeneousCore_CUDAUtilities_deviceAllocatorStatus_h
0003 
0004 #include <cstddef>
0005 #include <map>
0006 
0007 namespace cms {
0008   namespace cuda {
0009     namespace allocator {
0010       struct TotalBytes {
0011         // CMS: add explicit std namespace
0012         std::size_t free;
0013         std::size_t live;
0014         std::size_t liveRequested;  // CMS: monitor also requested amount
0015         TotalBytes() { free = live = liveRequested = 0; }
0016       };
0017       /// Map type of device ordinals to the number of cached bytes cached by each device
0018       using GpuCachedBytes = std::map<int, TotalBytes>;
0019     }  // namespace allocator
0020 
0021     allocator::GpuCachedBytes deviceAllocatorStatus();
0022   }  // namespace cuda
0023 }  // namespace cms
0024 
0025 #endif