Skip to main content

cudaDeviceSetMemPool

Function cudaDeviceSetMemPool 

Source
pub unsafe extern "C" fn cudaDeviceSetMemPool(
    device: c_int,
    memPool: cudaMemPool_t,
) -> cudaError_t
Expand description

Sets the current memory pool of a device.

The memory pool must be local to the specified device. Unless a mempool is specified in the cudaMallocAsync call, cudaMallocAsync allocates from the current mempool of the provided stream’s device. By default, a device’s current memory pool is its default memory pool.

Note: Use cudaMallocFromPoolAsync to specify asynchronous allocations from a device different than the one the stream runs on.

Note that this function may also return error codes from previous, asynchronous launches.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Return value

See also: cuDeviceSetMemPool, cudaDeviceGetMemPool, cudaDeviceGetDefaultMemPool, cudaMemPoolCreate, cudaMemPoolDestroy, cudaMallocFromPoolAsync.