MemoryPointer#

class nvmath.MemoryPointer(
device_ptr: int,
size: int,
finalizer: None | Callable[[], None],
)[source]#

An RAII class for a device memory buffer.

Parameters:
  • device_ptr – The address of the device memory buffer.

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

  • finalizer – A nullary callable that will be called when the buffer is to be freed.

Methods

__init__(
device_ptr: int,
size: int,
finalizer: None | Callable[[], None],
)[source]#
free()[source]#

“Frees” the memory buffer by calling the finalizer.