vt::Mempool#

void vt::check_cuda_errors(cudaError_t err, const std::string &message)#

Check the CUDA errors.

Parameters:
  • err – The CUDA error code.

  • message – The error message.

int vt::get_number_of_gpus()#

Get the number of GPUs.

Returns:

int: The number of GPUs.

class Mempool#

A class that manages a memory pool for the current GPU.

Public Functions

Mempool(size_t pool_size, const std::string &log_filepath)#

Construct a Mempool object.

Parameters:
  • pool_size – The size of the memory pool.

  • log_filepath – The log file path for memory usage logging.

~Mempool()#

Destroy the Mempool object.

class MempoolImpl#

Private implementation pointer. This could reduce compilation time for RMM headers.

Public Functions

inline MempoolImpl(size_t pool_size, const std::string &log_filepath)#

Construct a new Mempool Impl object.

Parameters:
  • pool_size – The size of the memory pool.

  • log_filepath – The log file path for memory usage logging.

class PinnedMempool#

A class that manages a pinned memory pool.

Public Functions

PinnedMempool(size_t initial_pinned_pool_size, size_t pinned_pool_size)#

Construct a PinnedMempool object.

Parameters:
  • initial_pinned_pool_size – The initial size of the pinned memory pool.

  • pinned_pool_size – The size of the pinned memory pool.

~PinnedMempool()#

Destroy the PinnedMempool object.

void deallocate(void *ptr, size_t size)#

Deallocate the memory for the given pointer and size.

Parameters:
  • ptr – The pointer to the memory.

  • size – The size of the memory.

void *allocate(size_t size)#

Allocate the memory for the given size.

Parameters:

size – The size of the memory.

Returns:

void*: The pointer to the allocated memory.

class PinnedMempoolImpl#

Private implementation pointer for PinnedMempool. This could reduce compilation time for RMM headers.

Public Functions

inline PinnedMempoolImpl(size_t initial_pinned_pool_size, size_t pinned_pool_size)#

Construct a new Pinned Mempool Impl object.

Parameters:
  • initial_pinned_pool_size – The initial size of the pinned memory pool.

  • pinned_pool_size – The size of the pinned memory pool.

class GlobalMempool#

Singleton class for global memory pool management.

Public Static Functions

static GlobalMempool &get_instance(size_t pool_size)#

Get the Instance object. It returns the singleton instance of the global memory pool.

Parameters:

pool_size – The size of the memory pool.

Returns:

GlobalMempool&: The global memory pool instance.

class GlobalMempoolInitializer#

Global memory pool initializer for VTensor.