Function rcudnn::cudaMallocAsync[][src]

pub unsafe extern "C" fn cudaMallocAsync(
    devPtr: *mut *mut c_void,
    size: usize,
    hStream: *mut CUstream_st
) -> cudaError
Expand description

\brief Allocates memory with stream ordered semantics

Inserts an allocation operation into \p hStream. 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 memory pool associated with the stream’s device.

\note The default memory pool of a device contains device memory from that device. \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.

\param[out] devPtr - Returned device pointer \param[in] size - Number of bytes to allocate \param[in] hStream - The stream establishing the stream ordering contract and the memory pool to allocate from

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorNotSupported, ::cudaErrorOutOfMemory, \notefnerr \note_null_stream \note_init_rt \note_callback

\sa ::cuMemAllocAsync, \ref ::cudaMallocAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) “cudaMallocAsync (C++ API)”, ::cudaMallocFromPoolAsync, ::cudaFreeAsync, ::cudaDeviceSetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolSetAccess, ::cudaMemPoolSetAttribute, ::cudaMemPoolGetAttribute