Filter löschen
Filter löschen

How can I set shared memory configuration for NVIDIA graphics card to increase L1 cache?

5 Ansichten (letzte 30 Tage)
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?

Antworten (1)

Joss Knight
Joss Knight am 26 Feb. 2016
Bearbeitet: Joss Knight am 26 Feb. 2016
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.

Kategorien

Mehr zu GPU Computing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by