cuda.bindings._v2.driver.mem_alloc_from_pool_async#

cuda.bindings._v2.driver.mem_alloc_from_pool_async(
size_t bytesize,
intptr_t pool,
intptr_t h_stream,
) → uint64_t#

Allocates memory from a specified pool with stream ordered semantics.

Inserts an allocation operation into h_stream. A pointer to the allocated memory is returned immediately in *dptr. The allocation must not be accessed until the the allocation operation completes. The allocation comes from the specified memory pool.

Parameters:
  • bytesize (size_t) – Number of bytes to allocate.

  • pool (intptr_t) – The pool to allocate from.

  • h_stream (intptr_t) – The stream establishing the stream ordering semantic.

Returns:

Returned device pointer.

Return type:

uint64_t

Note

The specified memory pool may be from a device different than that of the specified h_stream.

Note

Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs.

Note

During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool’s properties are used to set the node’s creation parameters.

See also

cuMemAllocFromPoolAsync