BaseCUDAMemoryManagerAsync#

class nvmath.BaseCUDAMemoryManagerAsync(device_id: int, logger: Logger)[source]#

Protocol for async memory manager plugins.

Methods

abstract __init__(
device_id: int,
logger: Logger,
)[source]#
abstract memalloc_async(
size: int,
stream: Stream,
) MemoryPointer[source]#

Allocate device memory asynchronously on the provided stream.

Parameters:
  • size – The size of the memory buffer in bytes.

  • stream – A cuda.core.Stream object on which the allocation will be performed.

Returns:

An object that owns the allocated memory and is responsible for releasing it (to the OS or a pool). The object must have an attribute named device_ptr, device_pointer, or ptr specifying the pointer to the allocated memory buffer. See MemoryPointer for an example interface.

Note

Objects of type numba.cuda.MemoryPointer as well as cupy.cuda.MemoryPointer meet the requirements listed above for the device memory pointer object.