pub unsafe extern "C" fn cudaDeviceSetCacheConfig(
cacheConfig: cudaFuncCache,
) -> cudaError_tExpand description
Sets the preferred cache configuration for the current device.
On devices where the L1 cache and shared memory use the same hardware resources, this sets through cacheConfig the preferred cache configuration for the current device. This is only a preference. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required to execute the function. Any function preference set via cudaFuncSetCacheConfig (C API) or cudaFuncSetCacheConfig (C++ API) will be preferred over this device-wide setting. Setting the device-wide cache configuration to cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel.
This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
The supported cache configurations are:
cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default)cudaFuncCache::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cachecudaFuncCache::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memorycudaFuncCache::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal size L1 cache and shared memory.
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
cacheConfig: Requested cache configuration
§Return value
See also: cudaDeviceGetCacheConfig, cudaFuncSetCacheConfig (C API), cudaFuncSetCacheConfig (C++ API), cuCtxSetCacheConfig.