6.9. 执行控制 [已弃用]

本节介绍CUDA运行时应用程序编程接口中已弃用的执行控制函数。

部分函数在C++ API Routines模块中提供了重载的C++ API模板版本,相关文档单独列出。

Functions

__host__cudaError_t cudaFuncSetSharedMemConfig ( const void* func, cudaSharedMemConfig config )
Sets the shared memory configuration for a device function.

Functions

__host__cudaError_t cudaFuncSetSharedMemConfig ( const void* func, cudaSharedMemConfig config )
设置设备函数的共享内存配置。
参数
func
- Device function symbol
config
- Requested shared memory configuration
已弃用

描述
On devices with configurable shared memory banks, this function will force all subsequent launches of the specified device function to have the given shared memory bank size configuration. On any given launch of the function, the shared memory configuration of the device will be temporarily changed if needed to suit the function's preferred configuration. Changes in shared memory configuration between subsequent launches of functions, may introduce a device side synchronization point.

通过cudaFuncSetSharedMemConfig设置的每个函数的共享内存bank大小设置将覆盖由cudaDeviceSetSharedMemConfig设置的设备全局设置。

更改共享内存的存储体大小不会增加共享内存的使用量或影响内核的占用率,但可能会对性能产生重大影响。较大的存储体大小可以带来更高的共享内存潜在带宽,但会改变哪些类型的共享内存访问会导致存储体冲突。

此函数在具有固定共享内存库大小的设备上将不执行任何操作。

对于模板化函数,按以下方式传递函数符号:func_name

支持的银行配置包括:

  • cudaSharedMemBankSizeDefault: 启动此函数时使用设备的共享内存配置。

  • cudaSharedMemBankSizeFourByte: 在启动此函数时,将共享内存存储体的宽度原生设置为4字节。

  • cudaSharedMemBankSizeEightByte: 在启动此函数时,将共享内存存储体的宽度原生设置为8字节。

Note:

另请参阅:

cudaDeviceSetSharedMemConfig, cudaDeviceGetSharedMemConfig, cudaDeviceSetCacheConfig, cudaDeviceGetCacheConfig, cudaFuncSetCacheConfig, cuFuncSetSharedMemConfig