Skip to main content

cudaDeviceSetLimit

Function cudaDeviceSetLimit 

Source
pub unsafe extern "C" fn cudaDeviceSetLimit(
    limit: cudaLimit,
    value: size_t,
) -> cudaError_t
Expand description

Set resource limits.

Setting limit to value is a request by the application to update the current limit maintained by the device. The driver is free to modify the requested value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size, etc). The application can use cudaDeviceGetLimit to find out exactly what the limit has been set to.

Setting each cudaLimit has its own specific restrictions, so each is discussed here.

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

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

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.

§Parameters

  • limit: Limit to set.
  • value: Size of limit.

§Return value

See also: cudaDeviceGetLimit, cuCtxSetLimit.