cuda.core.experimental.LegacyPinnedMemoryResource#
- class cuda.core.experimental.LegacyPinnedMemoryResource#
Create a pinned memory resource that uses legacy cuMemAllocHost/cudaMallocHost APIs.
Methods
- __init__(self)#
- allocate(
- self,
- size_t size,
- stream: Stream = None,
Allocate a buffer of the requested size.
- deallocate(
- self,
- ptr: DevicePointerT,
- size_t size,
- stream: Stream = None,
Deallocate a buffer previously allocated by this resource.
- Parameters:
ptr (
DevicePointerT
) – The pointer or handle to the buffer to deallocate.size (int) – The size of the buffer to deallocate, in bytes.
stream (Stream, optional) – The stream on which to perform the deallocation asynchronously. If None, no synchronization would happen.
Attributes