pub unsafe extern "C" fn cuFuncSetCacheConfig(
hfunc: CUfunction,
config: CUfunc_cache,
) -> CUresultExpand description
Sets the preferred cache configuration for a device function.
On devices where the L1 cache and shared memory use the same hardware resources, this sets through config the preferred cache configuration for the device function hfunc. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute hfunc. Any context-wide preference set via cuCtxSetCacheConfig will be overridden by this per-function setting unless the per-function setting is CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE. In that case, the current context-wide setting will be used.
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:
CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default)CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cacheCUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memoryCUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal sized L1 cache and shared memory.
Note that this function may also return error codes from previous, asynchronous launches.
§Parameters
hfunc: Kernel to configure cache for.config: Requested cache configuration.
§Return value
CUresult::CUDA_SUCCESSCUresult::CUDA_ERROR_INVALID_VALUECUresult::CUDA_ERROR_DEINITIALIZEDCUresult::CUDA_ERROR_NOT_INITIALIZEDCUresult::CUDA_ERROR_INVALID_CONTEXT
See also: cuCtxGetCacheConfig, cuCtxSetCacheConfig, cuFuncGetAttribute, cuLaunchKernel, cudaFuncSetCacheConfig, cuKernelSetCacheConfig.