CUDA Driver API 相当于 cudaDeviceSetCacheConfig
CUDA Driver API equivalent to cudaDeviceSetCacheConfig
比较 CUDA(最新,撰写时 v11.3)驱动程序 API 与运行时 API 表明运行时 API 具有功能
__host__ cudaError_t cudaDeviceSetCacheConfig ( cudaFuncCache cacheConfig )
Sets the preferred cache configuration for the current device.
驱动程序API似乎没有等效功能。了解为什么会这样,是否有办法使用驱动程序设置设备范围的缓存配置 API?
对应的函数在cuCtxSetCacheConfig
中有记载here。
差异的原因在于driver API focuses on context behavior. The runtime API generally posits that for a particular process owner, there is only one context per device。 (因此它通常在视图中有一个“设备”而不是上下文。)驱动程序 API 不一定如此。因此,您可以根据上下文进行设置。
如果每个设备只有一个上下文,则该控件实际上是“设备范围的”。
比较 CUDA(最新,撰写时 v11.3)驱动程序 API 与运行时 API 表明运行时 API 具有功能
__host__ cudaError_t cudaDeviceSetCacheConfig ( cudaFuncCache cacheConfig )
Sets the preferred cache configuration for the current device.
驱动程序API似乎没有等效功能。了解为什么会这样,是否有办法使用驱动程序设置设备范围的缓存配置 API?
对应的函数在cuCtxSetCacheConfig
中有记载here。
差异的原因在于driver API focuses on context behavior. The runtime API generally posits that for a particular process owner, there is only one context per device。 (因此它通常在视图中有一个“设备”而不是上下文。)驱动程序 API 不一定如此。因此,您可以根据上下文进行设置。
如果每个设备只有一个上下文,则该控件实际上是“设备范围的”。