Function rcudnn_sys::cudaDeviceSetCacheConfig[][src]

pub unsafe extern "C" fn cudaDeviceSetCacheConfig(
    cacheConfig: cudaFuncCache
) -> cudaError_t
Expand description

\brief 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 \p 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 \ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) “cudaFuncSetCacheConfig (C API)” or \ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) “cudaFuncSetCacheConfig (C++ API)” will be preferred over this device-wide setting. Setting the device-wide cache configuration to ::cudaFuncCachePreferNone 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:

  • ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)
  • ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache
  • ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory
  • ::cudaFuncCachePreferEqual: prefer equal size L1 cache and shared memory

\param cacheConfig - Requested cache configuration

\return ::cudaSuccess \notefnerr \note_init_rt \note_callback

\sa ::cudaDeviceGetCacheConfig, \ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) “cudaFuncSetCacheConfig (C API)”, \ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) “cudaFuncSetCacheConfig (C++ API)”, ::cuCtxSetCacheConfig