cuda.core.GraphMemoryResource#
- class cuda.core.GraphMemoryResource(device_id: int | Device)#
A memory resource for memory related to graphs.
The only supported operations are allocation, deallocation, and a limited set of status queries.
This memory resource should be used when building graphs. Using this when graphs capture is not enabled will result in a runtime error.
Conversely, allocating memory from a DeviceMemoryResource when graph capturing is enabled results in a runtime error.
- Parameters:
device_id (int | Device) – Device or Device ordinal for which a graph memory resource is obtained.
Methods
- __init__()#
- allocate(
- self,
- size_t size,
- stream: Stream | GraphBuilder | None = None,
Allocate a buffer of the requested size. See documentation for
MemoryResource.
- close(self)#
No operation (provided for compatibility).
- deallocate(
- self,
- ptr: DevicePointerT,
- size_t size,
- stream: Stream | GraphBuilder | None = None,
Deallocate a buffer of the requested size. See documentation for
MemoryResource.
- trim(self)#
Free unused memory that was cached on the specified device for use with graphs back to the OS.
Attributes
- attributes#
GraphMemoryResourceAttributes
Asynchronous allocation attributes related to graphs.
- Type:
cyGraphMemoryResource.attributes
- device_id#
int
The associated device ordinal.
- Type:
cyGraphMemoryResource.device_id
- is_device_accessible#
bool
Return True. This memory resource provides device-accessible buffers.
- Type:
cyGraphMemoryResource.is_device_accessible
- is_host_accessible#
bool
Return False. This memory resource does not provide host-accessible buffers.
- Type:
cyGraphMemoryResource.is_host_accessible