cuquantum.MemoryPointer

class cuquantum.MemoryPointer(device_ptr, size, finalizer)[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, size, finalizer)[source]
free()[source]

“Frees” the memory buffer by calling the finalizer.