CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
notcub::CachingDeviceAllocator Struct Reference

A simple caching allocator for device memory allocations. More...

#include <CachingDeviceAllocator.h>

Classes

struct  BlockDescriptor
 

Public Types

typedef std::multiset< BlockDescriptor, CompareBusyBlocks
 Set type for live blocks (ordered by ptr) More...
 
typedef std::multiset< BlockDescriptor, CompareCachedBlocks
 Set type for cached blocks (ordered by size) More...
 
typedef bool(* Compare) (const BlockDescriptor &, const BlockDescriptor &)
 BlockDescriptor comparator function interface. More...
 
using GpuCachedBytes = cms::cuda::allocator::GpuCachedBytes
 Map type of device ordinals to the number of cached bytes cached by each device. More...
 

Public Member Functions

GpuCachedBytes CacheStatus () const
 
 CachingDeviceAllocator (bool skip_cleanup=false, bool debug=false)
 Default constructor. More...
 
 CachingDeviceAllocator (unsigned int bin_growth, unsigned int min_bin=1, unsigned int max_bin=INVALID_BIN, size_t max_cached_bytes=INVALID_SIZE, bool skip_cleanup=false, bool debug=false)
 Set of live device allocations currently in use. More...
 
cudaError_t DeviceAllocate (int device, void **d_ptr, size_t bytes, cudaStream_t active_stream=nullptr)
 Provides a suitable allocation of device memory for the given size on the specified device. More...
 
cudaError_t DeviceAllocate (void **d_ptr, size_t bytes, cudaStream_t active_stream=nullptr)
 Provides a suitable allocation of device memory for the given size on the current device. More...
 
cudaError_t DeviceFree (int device, void *d_ptr)
 Frees a live allocation of device memory on the specified device, returning it to the allocator. More...
 
cudaError_t DeviceFree (void *d_ptr)
 Frees a live allocation of device memory on the current device, returning it to the allocator. More...
 
cudaError_t FreeAllCached ()
 Frees all cached device allocations on all devices. More...
 
void NearestPowerOf (unsigned int &power, size_t &rounded_bytes, unsigned int base, size_t value)
 
cudaError_t SetMaxCachedBytes (size_t max_cached_bytes)
 Sets the limit on the number bytes this allocator is allowed to cache per device. More...
 
 ~CachingDeviceAllocator ()
 Destructor. More...
 

Static Public Member Functions

static unsigned int IntPow (unsigned int base, unsigned int exp)
 

Public Attributes

unsigned int bin_growth
 Mutex for thread-safety. More...
 
CachedBlocks cached_blocks
 Map of device ordinal to aggregate cached bytes on that device. More...
 
GpuCachedBytes cached_bytes
 Whether or not to print (de)allocation events to stdout. More...
 
bool debug
 Whether or not to skip a call to FreeAllCached() when destructor is called. (The CUDA runtime may have already shut down for statically declared allocators) More...
 
BusyBlocks live_blocks
 Set of cached device allocations available for reuse. More...
 
unsigned int max_bin
 Minimum bin enumeration. More...
 
size_t max_bin_bytes
 Minimum bin size. More...
 
size_t max_cached_bytes
 Maximum bin size. More...
 
unsigned int min_bin
 Geometric growth factor for bin-sizes. More...
 
size_t min_bin_bytes
 Maximum bin enumeration. More...
 
std::mutex mutex
 
const bool skip_cleanup
 Maximum aggregate cached bytes per device. More...
 

Static Public Attributes

static const unsigned int INVALID_BIN = (unsigned int)-1
 Out-of-bounds bin. More...
 
static const int INVALID_DEVICE_ORDINAL = -1
 Invalid device ordinal. More...
 
static const size_t INVALID_SIZE = (size_t)-1
 Invalid size. More...
 

Detailed Description

A simple caching allocator for device memory allocations.

Overview
The allocator is thread-safe and stream-safe and is capable of managing cached device allocations on multiple devices. It behaves as follows:
  • Allocations from the allocator are associated with an active_stream. Once freed, the allocation becomes available immediately for reuse within the active_stream with which it was associated with during allocation, and it becomes available for reuse within other streams when all prior work submitted to active_stream has completed.
  • Allocations are categorized and cached by bin size. A new allocation request of a given size will only consider cached allocations within the corresponding bin.
  • Bin limits progress geometrically in accordance with the growth factor bin_growth provided during construction. Unused device allocations within a larger bin cache are not reused for allocation requests that categorize to smaller bin sizes.
  • Allocation requests below (bin_growth ^ min_bin) are rounded up to (bin_growth ^ min_bin).
  • Allocations above (bin_growth ^ max_bin) are not rounded up to the nearest bin and are simply freed when they are deallocated instead of being returned to a bin-cache.
  • If the total storage of cached allocations on a given device will exceed max_cached_bytes, allocations for that device are simply freed when they are deallocated instead of being returned to their bin-cache.
For example, the default-constructed CachingDeviceAllocator is configured with:
  • bin_growth = 8
  • min_bin = 3
  • max_bin = 7
  • max_cached_bytes = 6MB - 1B
which delineates five bin-sizes: 512B, 4KB, 32KB, 256KB, and 2MB and sets a maximum of 6,291,455 cached bytes per device

Definition at line 124 of file CachingDeviceAllocator.h.

Member Typedef Documentation

◆ BusyBlocks

Set type for live blocks (ordered by ptr)

Definition at line 203 of file CachingDeviceAllocator.h.

◆ CachedBlocks

Set type for cached blocks (ordered by size)

Definition at line 200 of file CachingDeviceAllocator.h.

◆ Compare

typedef bool(* notcub::CachingDeviceAllocator::Compare) (const BlockDescriptor &, const BlockDescriptor &)

BlockDescriptor comparator function interface.

Definition at line 195 of file CachingDeviceAllocator.h.

◆ GpuCachedBytes

Map type of device ordinals to the number of cached bytes cached by each device.

Definition at line 207 of file CachingDeviceAllocator.h.

Constructor & Destructor Documentation

◆ CachingDeviceAllocator() [1/2]

notcub::CachingDeviceAllocator::CachingDeviceAllocator ( unsigned int  bin_growth,
unsigned int  min_bin = 1,
unsigned int  max_bin = INVALID_BIN,
size_t  max_cached_bytes = INVALID_SIZE,
bool  skip_cleanup = false,
bool  debug = false 
)
inline

Set of live device allocations currently in use.

Constructor.

Parameters
bin_growthGeometric growth factor for bin-sizes
min_binMinimum bin (default is bin_growth ^ 1)
max_binMaximum bin (default is no max bin)
max_cached_bytesMaximum aggregate cached bytes per device (default is no limit)
skip_cleanupWhether or not to skip a call to FreeAllCached() when the destructor is called (default is to deallocate)
debugWhether or not to print (de)allocation events to stdout (default is no stderr output)

Definition at line 280 of file CachingDeviceAllocator.h.

284  : 512B, 4KB, 32KB, 256KB, and 2MB and
285  * sets a maximum of 6,291,455 cached bytes per device
286  */
287  CachingDeviceAllocator(bool skip_cleanup = false, bool debug = false)
288  : bin_growth(8),
289  min_bin(3),
290  max_bin(7),
293  max_cached_bytes((max_bin_bytes * 3) - 1),
295  debug(debug),
296  cached_blocks(BlockDescriptor::SizeCompare),
297  live_blocks(BlockDescriptor::PtrCompare) {}

◆ CachingDeviceAllocator() [2/2]

notcub::CachingDeviceAllocator::CachingDeviceAllocator ( bool  skip_cleanup = false,
bool  debug = false 
)
inline

Default constructor.

Configured with:

  • bin_growth = 8
  • min_bin = 3
  • max_bin = 7
  • max_cached_bytes = (bin_growth ^ max_bin) * 3) - 1 = 6,291,455 bytes

which delineates five bin-sizes: 512B, 4KB, 32KB, 256KB, and 2MB and sets a maximum of 6,291,455 cached bytes per device

Definition at line 312 of file CachingDeviceAllocator.h.

336  {

◆ ~CachingDeviceAllocator()

notcub::CachingDeviceAllocator::~CachingDeviceAllocator ( )
inline

Destructor.

Definition at line 762 of file CachingDeviceAllocator.h.

Member Function Documentation

◆ CacheStatus()

GpuCachedBytes notcub::CachingDeviceAllocator::CacheStatus ( ) const
inline

Definition at line 753 of file CachingDeviceAllocator.h.

Referenced by cms::cuda::deviceAllocatorStatus().

◆ DeviceAllocate() [1/2]

cudaError_t notcub::CachingDeviceAllocator::DeviceAllocate ( int  device,
void **  d_ptr,
size_t  bytes,
cudaStream_t  active_stream = nullptr 
)
inline

Provides a suitable allocation of device memory for the given size on the specified device.

Once freed, the allocation becomes available immediately for reuse within the active_stream with which it was associated with during allocation, and it becomes available for reuse within other streams when all prior work submitted to active_stream has completed.

Parameters
[in]deviceDevice on which to place the allocation
[out]d_ptrReference to pointer to the allocation
[in]bytesMinimum number of bytes for the allocation
[in]active_streamThe stream to be associated with this allocation

Definition at line 356 of file CachingDeviceAllocator.h.

356  {
357  // Bin is greater than our maximum bin: allocate the request
358  // exactly and give out-of-bounds bin. It will not be cached
359  // for reuse when returned.
360  search_key.bin = INVALID_BIN;
361  search_key.bytes = bytes;
362  } else {
363  // Search for a suitable cached allocation: lock
364  mutex_locker.lock();
365 
366  if (search_key.bin < min_bin) {
367  // Bin is less than minimum bin: round up
368  search_key.bin = min_bin;
369  search_key.bytes = min_bin_bytes;
370  }
371 
372  // Iterate through the range of cached blocks on the same device in the same bin
373  CachedBlocks::iterator block_itr = cached_blocks.lower_bound(search_key);
374  while ((block_itr != cached_blocks.end()) && (block_itr->device == device) &&
375  (block_itr->bin == search_key.bin)) {
376  // To prevent races with reusing blocks returned by the host but still
377  // in use by the device, only consider cached blocks that are
378  // either (from the active stream) or (from an idle stream)
379  if ((active_stream == block_itr->associated_stream) ||
380  (cudaEventQuery(block_itr->ready_event) != cudaErrorNotReady)) {
381  // Reuse existing cache block. Insert into live blocks.
382  found = true;
383  search_key = *block_itr;
384  search_key.associated_stream = active_stream;
385  live_blocks.insert(search_key);
386 
387  // Remove from free blocks
388  cached_bytes[device].free -= search_key.bytes;
389  cached_bytes[device].live += search_key.bytes;
390  cached_bytes[device].liveRequested += search_key.bytesRequested; // CMS
391 
392  if (debug)
393  // CMS: improved debug message
394  // CMS: use raw printf
395  printf(
396  "\tDevice %d reused cached block at %p (%lld bytes) for stream %lld, event %lld (previously "
397  "associated with stream %lld, event %lld).\n",
398  device,
399  search_key.d_ptr,
400  (long long)search_key.bytes,
401  (long long)search_key.associated_stream,
402  (long long)search_key.ready_event,
403  (long long)block_itr->associated_stream,
404  (long long)block_itr->ready_event);
405 
406  cached_blocks.erase(block_itr);
407 
408  break;
409  }
410  block_itr++;
411  }
412 
413  // Done searching: unlock
414  mutex_locker.unlock();
415  }
416 
417  // Allocate the block if necessary
418  if (!found) {
419  // Set runtime's current device to specified device (entrypoint may not be set)
420  if (device != entrypoint_device) {
421  // CMS: throw exception on error
422  cudaCheck(error = cudaGetDevice(&entrypoint_device));
423  cudaCheck(error = cudaSetDevice(device));
424  }
425 
426  // Attempt to allocate
427  // CMS: silently ignore errors and retry or pass them to the caller
428  if ((error = cudaMalloc(&search_key.d_ptr, search_key.bytes)) == cudaErrorMemoryAllocation) {
429  // The allocation attempt failed: free all cached blocks on device and retry
430  if (debug)
431  // CMS: use raw printf
432  printf(
433  "\tDevice %d failed to allocate %lld bytes for stream %lld, retrying after freeing cached allocations",
434  device,
435  (long long)search_key.bytes,
436  (long long)search_key.associated_stream);
437 
438  error = cudaSuccess; // Reset the error we will return
439  cudaGetLastError(); // Reset CUDART's error
440 
441  // Lock
442  mutex_locker.lock();
443 
444  // Iterate the range of free blocks on the same device
445  BlockDescriptor free_key(device);
446  CachedBlocks::iterator block_itr = cached_blocks.lower_bound(free_key);
447 
448  while ((block_itr != cached_blocks.end()) && (block_itr->device == device)) {
449  // No need to worry about synchronization with the device: cudaFree is
450  // blocking and will synchronize across all kernels executing
451  // on the current device
452 
453  // Free device memory and destroy stream event.
454  // CMS: silently ignore errors and pass them to the caller
455  if ((error = cudaFree(block_itr->d_ptr)))
456  break;
457  if ((error = cudaEventDestroy(block_itr->ready_event)))
458  break;
459 
460  // Reduce balance and erase entry
461  cached_bytes[device].free -= block_itr->bytes;
462 
463  if (debug)
464  // CMS: use raw printf
465  printf(
466  "\tDevice %d freed %lld bytes.\n\t\t %lld available blocks cached (%lld bytes), %lld live blocks "
467  "(%lld bytes) outstanding.\n",
468  device,
469  (long long)block_itr->bytes,
470  (long long)cached_blocks.size(),
471  (long long)cached_bytes[device].free,
472  (long long)live_blocks.size(),
473  (long long)cached_bytes[device].live);
474 
475  cached_blocks.erase(block_itr);
476 
477  block_itr++;
478  }
479 
480  // Unlock
481  mutex_locker.unlock();
482 
483  // Return under error
484  if (error)
485  return error;
486 
487  // Try to allocate again
488  // CMS: throw exception on error
489  cudaCheck(error = cudaMalloc(&search_key.d_ptr, search_key.bytes));
490  }
491 
492  // Create ready event
493  // CMS: throw exception on error
494  cudaCheck(error = cudaEventCreateWithFlags(&search_key.ready_event, cudaEventDisableTiming));
495 
496  // Insert into live blocks
497  mutex_locker.lock();
498  live_blocks.insert(search_key);
499  cached_bytes[device].live += search_key.bytes;
500  cached_bytes[device].liveRequested += search_key.bytesRequested; // CMS
501  mutex_locker.unlock();
502 
503  if (debug)
504  // CMS: improved debug message
505  // CMS: use raw printf
506  printf("\tDevice %d allocated new device block at %p (%lld bytes associated with stream %lld, event %lld).\n",
507  device,
508  search_key.d_ptr,
509  (long long)search_key.bytes,
510  (long long)search_key.associated_stream,
511  (long long)search_key.ready_event);
512 
513  // Attempt to revert back to previous device if necessary
514  if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) {
515  // CMS: throw exception on error
516  cudaCheck(error = cudaSetDevice(entrypoint_device));
517  }
518  }
519 
520  // Copy device pointer to output parameter
521  *d_ptr = search_key.d_ptr;
522 
523  if (debug)
524  // CMS: use raw printf
525  printf("\t\t%lld available blocks cached (%lld bytes), %lld live blocks outstanding(%lld bytes).\n",
526  (long long)cached_blocks.size(),
527  (long long)cached_bytes[device].free,
528  (long long)live_blocks.size(),
529  (long long)cached_bytes[device].live);
530 
531  return error;
532  }
533 
541  cudaError_t DeviceAllocate(
542  void **d_ptr,
543  size_t bytes,
544  cudaStream_t active_stream = nullptr)
545  {
546  return DeviceAllocate(INVALID_DEVICE_ORDINAL, d_ptr, bytes, active_stream);
547  }
548 
556  cudaError_t DeviceFree(int device, void *d_ptr) {
557  int entrypoint_device = INVALID_DEVICE_ORDINAL;

References INVALID_BIN.

◆ DeviceAllocate() [2/2]

cudaError_t notcub::CachingDeviceAllocator::DeviceAllocate ( void **  d_ptr,
size_t  bytes,
cudaStream_t  active_stream = nullptr 
)
inline

Provides a suitable allocation of device memory for the given size on the current device.

Once freed, the allocation becomes available immediately for reuse within the active_stream with which it was associated with during allocation, and it becomes available for reuse within other streams when all prior work submitted to active_stream has completed.

Parameters
[out]d_ptrReference to pointer to the allocation
[in]bytesMinimum number of bytes for the allocation
[in]active_streamThe stream to be associated with this allocation

Definition at line 566 of file CachingDeviceAllocator.h.

◆ DeviceFree() [1/2]

cudaError_t notcub::CachingDeviceAllocator::DeviceFree ( int  device,
void *  d_ptr 
)
inline

Frees a live allocation of device memory on the specified device, returning it to the allocator.

Once freed, the allocation becomes available immediately for reuse within the active_stream with which it was associated with during allocation, and it becomes available for reuse within other streams when all prior work submitted to active_stream has completed.

Definition at line 581 of file CachingDeviceAllocator.h.

583  {
584  // Insert returned allocation into free blocks
585  recached = true;
586  cached_blocks.insert(search_key);
587  cached_bytes[device].free += search_key.bytes;
588 
589  if (debug)
590  // CMS: improved debug message
591  // CMS: use raw printf
592  printf(
593  "\tDevice %d returned %lld bytes at %p from associated stream %lld, event %lld.\n\t\t %lld available "
594  "blocks cached (%lld bytes), %lld live blocks outstanding. (%lld bytes)\n",
595  device,
596  (long long)search_key.bytes,
597  d_ptr,
598  (long long)search_key.associated_stream,
599  (long long)search_key.ready_event,
600  (long long)cached_blocks.size(),
601  (long long)cached_bytes[device].free,
602  (long long)live_blocks.size(),
603  (long long)cached_bytes[device].live);
604  }
605  }
606 
607  // First set to specified device (entrypoint may not be set)
608  if (device != entrypoint_device) {
609  // CMS: throw exception on error
610  cudaCheck(error = cudaGetDevice(&entrypoint_device));
611  cudaCheck(error = cudaSetDevice(device));
612  }
613 
614  if (recached) {
615  // Insert the ready event in the associated stream (must have current device set properly)
616  // CMS: throw exception on error
617  cudaCheck(error = cudaEventRecord(search_key.ready_event, search_key.associated_stream));
618  }
619 
620  // Unlock
621  mutex_locker.unlock();
622 
623  if (!recached) {
624  // Free the allocation from the runtime and cleanup the event.
625  // CMS: throw exception on error
626  cudaCheck(error = cudaFree(d_ptr));
627  cudaCheck(error = cudaEventDestroy(search_key.ready_event));
628 
629  if (debug)
630  // CMS: improved debug message
631  printf(
632  "\tDevice %d freed %lld bytes at %p from associated stream %lld, event %lld.\n\t\t %lld available "
633  "blocks cached (%lld bytes), %lld live blocks (%lld bytes) outstanding.\n",
634  device,
635  (long long)search_key.bytes,
636  d_ptr,
637  (long long)search_key.associated_stream,
638  (long long)search_key.ready_event,
639  (long long)cached_blocks.size(),
640  (long long)cached_bytes[device].free,
641  (long long)live_blocks.size(),
642  (long long)cached_bytes[device].live);
643  }
644 
645  // Reset device
646  if ((entrypoint_device != INVALID_DEVICE_ORDINAL) && (entrypoint_device != device)) {
647  // CMS: throw exception on error
648  cudaCheck(error = cudaSetDevice(entrypoint_device));
649  }
650 
651  return error;
652  }
653 
661  cudaError_t DeviceFree(void *d_ptr) { return DeviceFree(INVALID_DEVICE_ORDINAL, d_ptr); }
662 
666  cudaError_t FreeAllCached() {
667  cudaError_t error = cudaSuccess;
668  int entrypoint_device = INVALID_DEVICE_ORDINAL;
669  int current_device = INVALID_DEVICE_ORDINAL;
670  // CMS: use RAII instead of (un)locking explicitly
671  std::unique_lock<std::mutex> mutex_locker(mutex);
672 
673  while (!cached_blocks.empty()) {
674  // Get first block
675  CachedBlocks::iterator begin = cached_blocks.begin();
676 
677  // Get entry-point device ordinal if necessary

References cached_blocks, cached_bytes, debug, beam_dqm_sourceclient-live_cfg::live, and live_blocks.

◆ DeviceFree() [2/2]

cudaError_t notcub::CachingDeviceAllocator::DeviceFree ( void *  d_ptr)
inline

Frees a live allocation of device memory on the current device, returning it to the allocator.

Once freed, the allocation becomes available immediately for reuse within the active_stream with which it was associated with during allocation, and it becomes available for reuse within other streams when all prior work submitted to active_stream has completed.

Definition at line 686 of file CachingDeviceAllocator.h.

719 {

◆ FreeAllCached()

cudaError_t notcub::CachingDeviceAllocator::FreeAllCached ( )
inline

Frees all cached device allocations on all devices.

Definition at line 691 of file CachingDeviceAllocator.h.

719  {
720  // CMS: throw exception on error
721  cudaCheck(error = cudaSetDevice(entrypoint_device));
722  }
723 
724  return error;
725  }
726 
727  // CMS: give access to cache allocation status
728  GpuCachedBytes CacheStatus() const {
729  std::unique_lock mutex_locker(mutex);
730  return cached_bytes;
731  }
732 
736  // CMS: make the destructor not virtual
738  if (!skip_cleanup)
739  FreeAllCached();
740  }
741  };
742  // end group UtilMgmt
744 
745 } // namespace notcub
746 
747 #endif

Referenced by CUDAService::~CUDAService().

◆ IntPow()

static unsigned int notcub::CachingDeviceAllocator::IntPow ( unsigned int  base,
unsigned int  exp 
)
inlinestatic

Integer pow function for unsigned base and exponent

Definition at line 216 of file CachingDeviceAllocator.h.

217  {
218  rounded_bytes *= base;
219  power++;
220  }
221  }
222 
223  //---------------------------------------------------------------------
224  // Fields
225  //---------------------------------------------------------------------
226 

References newFWLiteAna::base.

Referenced by cms::cuda::allocator::getCachingDeviceAllocator(), and cms::cuda::allocator::getCachingHostAllocator().

◆ NearestPowerOf()

void notcub::CachingDeviceAllocator::NearestPowerOf ( unsigned int &  power,
size_t &  rounded_bytes,
unsigned int  base,
size_t  value 
)
inline

Round up to the nearest power-of

Definition at line 231 of file CachingDeviceAllocator.h.

◆ SetMaxCachedBytes()

cudaError_t notcub::CachingDeviceAllocator::SetMaxCachedBytes ( size_t  max_cached_bytes)
inline

Sets the limit on the number bytes this allocator is allowed to cache per device.

Changing the ceiling of cached bytes does not cause any allocations (in-use or cached-in-reserve) to be freed. See FreeAllCached().

Definition at line 330 of file CachingDeviceAllocator.h.

336  {
337  // CMS: use RAII instead of (un)locking explicitly
338  std::unique_lock<std::mutex> mutex_locker(mutex, std::defer_lock);
339  *d_ptr = nullptr;
340  int entrypoint_device = INVALID_DEVICE_ORDINAL;
341  cudaError_t error = cudaSuccess;
342 
343  if (device == INVALID_DEVICE_ORDINAL) {
344  // CMS: throw exception on error
345  cudaCheck(error = cudaGetDevice(&entrypoint_device));
346  device = entrypoint_device;
347  }

Member Data Documentation

◆ bin_growth

unsigned int notcub::CachingDeviceAllocator::bin_growth

Mutex for thread-safety.

Definition at line 255 of file CachingDeviceAllocator.h.

◆ cached_blocks

CachedBlocks notcub::CachingDeviceAllocator::cached_blocks

Map of device ordinal to aggregate cached bytes on that device.

Definition at line 268 of file CachingDeviceAllocator.h.

Referenced by DeviceFree().

◆ cached_bytes

GpuCachedBytes notcub::CachingDeviceAllocator::cached_bytes

Whether or not to print (de)allocation events to stdout.

Definition at line 267 of file CachingDeviceAllocator.h.

Referenced by DeviceFree().

◆ debug

bool notcub::CachingDeviceAllocator::debug

Whether or not to skip a call to FreeAllCached() when destructor is called. (The CUDA runtime may have already shut down for statically declared allocators)

Definition at line 265 of file CachingDeviceAllocator.h.

Referenced by DeviceFree(), rrapi.RRApi::dprint(), rrapi.RRApi::get(), runTauIdMVA.TauIDEmbedder::loadMVA_WPs_run2_2017(), and runTauIdMVA.TauIDEmbedder::runTauID().

◆ INVALID_BIN

const unsigned int notcub::CachingDeviceAllocator::INVALID_BIN = (unsigned int)-1
static

Out-of-bounds bin.

Definition at line 131 of file CachingDeviceAllocator.h.

Referenced by DeviceAllocate().

◆ INVALID_DEVICE_ORDINAL

const int notcub::CachingDeviceAllocator::INVALID_DEVICE_ORDINAL = -1
static

Invalid device ordinal.

Definition at line 139 of file CachingDeviceAllocator.h.

◆ INVALID_SIZE

const size_t notcub::CachingDeviceAllocator::INVALID_SIZE = (size_t)-1
static

Invalid size.

Definition at line 134 of file CachingDeviceAllocator.h.

◆ live_blocks

BusyBlocks notcub::CachingDeviceAllocator::live_blocks

Set of cached device allocations available for reuse.

Definition at line 269 of file CachingDeviceAllocator.h.

Referenced by DeviceFree().

◆ max_bin

unsigned int notcub::CachingDeviceAllocator::max_bin

Minimum bin enumeration.

Definition at line 257 of file CachingDeviceAllocator.h.

◆ max_bin_bytes

size_t notcub::CachingDeviceAllocator::max_bin_bytes

Minimum bin size.

Definition at line 260 of file CachingDeviceAllocator.h.

◆ max_cached_bytes

size_t notcub::CachingDeviceAllocator::max_cached_bytes

Maximum bin size.

Definition at line 261 of file CachingDeviceAllocator.h.

◆ min_bin

unsigned int notcub::CachingDeviceAllocator::min_bin

Geometric growth factor for bin-sizes.

Definition at line 256 of file CachingDeviceAllocator.h.

◆ min_bin_bytes

size_t notcub::CachingDeviceAllocator::min_bin_bytes

Maximum bin enumeration.

Definition at line 259 of file CachingDeviceAllocator.h.

◆ mutex

std::mutex notcub::CachingDeviceAllocator::mutex
mutable

Definition at line 253 of file CachingDeviceAllocator.h.

◆ skip_cleanup

const bool notcub::CachingDeviceAllocator::skip_cleanup

Maximum aggregate cached bytes per device.

Definition at line 264 of file CachingDeviceAllocator.h.

notcub::CachingDeviceAllocator::min_bin_bytes
size_t min_bin_bytes
Maximum bin enumeration.
Definition: CachingDeviceAllocator.h:259
notcub::CachingDeviceAllocator::live_blocks
BusyBlocks live_blocks
Set of cached device allocations available for reuse.
Definition: CachingDeviceAllocator.h:269
notcub::CachingDeviceAllocator::DeviceFree
cudaError_t DeviceFree(int device, void *d_ptr)
Frees a live allocation of device memory on the specified device, returning it to the allocator.
Definition: CachingDeviceAllocator.h:581
notcub::CachingDeviceAllocator::max_bin_bytes
size_t max_bin_bytes
Minimum bin size.
Definition: CachingDeviceAllocator.h:260
notcub::CachingDeviceAllocator::max_bin
unsigned int max_bin
Minimum bin enumeration.
Definition: CachingDeviceAllocator.h:257
notcub::CachingDeviceAllocator::min_bin
unsigned int min_bin
Geometric growth factor for bin-sizes.
Definition: CachingDeviceAllocator.h:256
notcub::CachingDeviceAllocator::mutex
std::mutex mutex
Definition: CachingDeviceAllocator.h:253
notcub::CachingDeviceAllocator::GpuCachedBytes
cms::cuda::allocator::GpuCachedBytes GpuCachedBytes
Map type of device ordinals to the number of cached bytes cached by each device.
Definition: CachingDeviceAllocator.h:207
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
relativeConstraints.error
error
Definition: relativeConstraints.py:53
notcub::CachingDeviceAllocator::CacheStatus
GpuCachedBytes CacheStatus() const
Definition: CachingDeviceAllocator.h:753
notcub::CachingDeviceAllocator::FreeAllCached
cudaError_t FreeAllCached()
Frees all cached device allocations on all devices.
Definition: CachingDeviceAllocator.h:691
notcub::CachingDeviceAllocator::DeviceAllocate
cudaError_t DeviceAllocate(int device, void **d_ptr, size_t bytes, cudaStream_t active_stream=nullptr)
Provides a suitable allocation of device memory for the given size on the specified device.
Definition: CachingDeviceAllocator.h:356
notcub::CachingDeviceAllocator::cached_bytes
GpuCachedBytes cached_bytes
Whether or not to print (de)allocation events to stdout.
Definition: CachingDeviceAllocator.h:267
notcub::CachingDeviceAllocator::IntPow
static unsigned int IntPow(unsigned int base, unsigned int exp)
Definition: CachingDeviceAllocator.h:216
notcub::CachingDeviceAllocator::cached_blocks
CachedBlocks cached_blocks
Map of device ordinal to aggregate cached bytes on that device.
Definition: CachingDeviceAllocator.h:268
notcub::CachingDeviceAllocator::skip_cleanup
const bool skip_cleanup
Maximum aggregate cached bytes per device.
Definition: CachingDeviceAllocator.h:264
a
double a
Definition: hdecay.h:119
beam_dqm_sourceclient-live_cfg.live
live
Definition: beam_dqm_sourceclient-live_cfg.py:33
notcub::CachingDeviceAllocator::~CachingDeviceAllocator
~CachingDeviceAllocator()
Destructor.
Definition: CachingDeviceAllocator.h:762
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
notcub::CachingDeviceAllocator::bin_growth
unsigned int bin_growth
Mutex for thread-safety.
Definition: CachingDeviceAllocator.h:255
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:62
notcub::CachingDeviceAllocator::INVALID_BIN
static const unsigned int INVALID_BIN
Out-of-bounds bin.
Definition: CachingDeviceAllocator.h:131
notcub::CachingDeviceAllocator::CachingDeviceAllocator
CachingDeviceAllocator(unsigned int bin_growth, unsigned int min_bin=1, unsigned int max_bin=INVALID_BIN, size_t max_cached_bytes=INVALID_SIZE, bool skip_cleanup=false, bool debug=false)
Set of live device allocations currently in use.
Definition: CachingDeviceAllocator.h:280
notcub::CachingDeviceAllocator::max_cached_bytes
size_t max_cached_bytes
Maximum bin size.
Definition: CachingDeviceAllocator.h:261
notcub::CachingDeviceAllocator::debug
bool debug
Whether or not to skip a call to FreeAllCached() when destructor is called. (The CUDA runtime may hav...
Definition: CachingDeviceAllocator.h:265
notcub::CachingDeviceAllocator::INVALID_DEVICE_ORDINAL
static const int INVALID_DEVICE_ORDINAL
Invalid device ordinal.
Definition: CachingDeviceAllocator.h:139
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92