How can I set shared memory configuration for NVIDIA graphics card to increase L1 cache?
5 次查看(过去 30 天)
显示 更早的评论
I need to set the shared memory configuration for NVIDIA graphics card by running the following command in C:
cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
This will set L1 cache to 48KB instead of default 16KB (to benefit from higher L1 cache hit rate in my application).
How do I do this if I don't want to use mex file but run CUDA kernel on GPU using precompiled PTX code?
0 个评论
回答(1 个)
Joss Knight
2016-2-26
编辑:Joss Knight
2016-2-26
You can't, but you can write a mex function to do it, that will affect your next CUDAKernel call.
MEX functions do not initialise the GPU on every call so I don't quite understand what is preventing you from using mex functions in this case. The mechanism through which kernels are launched are different so I couldn't say definitively whether using CUDAKernel or launching a kernel yourself using a MEX function would be faster.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!