|
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 .
This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
Switching between configuration modes may insert a device-side synchronization point for streamed kernel launches.
The supported cache modes are:
- CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default)
- CU_FUNC_CACHE_PREFER_SHARED: function prefers larger shared memory and smaller L1 cache.
- CU_FUNC_CACHE_PREFER_L1: function prefers larger L1 cache and smaller shared memory.
- Parameters:
-
| hfunc | - Kernel to configure cache for |
| config | - Requested cache configuration |
- Returns:
- CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT
- Note:
- Note that this function may also return error codes from previous, asynchronous launches.
- See also:
- cuFuncSetBlockShape, cuFuncGetAttribute, cuParamSetSize, cuParamSeti, cuParamSetf, cuParamSetv, cuParamSetTexRef, cuLaunch, cuLaunchGrid, cuLaunchGridAsync
|