How can I set shared memory configuration for NVIDIA graphics card to increase L1 cache?
조회 수: 4 (최근 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!