enabling L1 cache of __global

hi, how to enable L1 cache for __global memory?

Generally speaking, OpenCL doesn’t have those kinds of low-level controls. If an implementation doesn’t want to cache global memory reads, then they won’t be cached. If an implementation wants a 3-level cache architecture for global memory, OpenCL doesn’t forbid that either.

implementation of opencl? of my kernel? which implementation? sorry, this post doesn’t satisfy me

how to do that implementation wants a 3-level cache architecture?

OpenCL only defines global memory space as (basically) something where OpenCL buffers reside. OpenCL driver is allowed to do whatever it wants, given it complies the specification. Caching is either built-in into OpenCL implementation or it is not (well, I doubt there are implementations that don’t have this feature) and there is nothing you need to do specifically. It just works.

I mean this, from http://acceleware.com/blog/opt-in-L1-caching-global-loads

“Even on Kepler GPUs that do support caching global memory in L1, the default behavior is to not cache global memory in L1. You have to opt-in to enable caching by passing -Xptxas=”-dlcm=ca" as an argument to NVCC when compiling your kernels."

I want to do the same but in opencl

Then you would need some kind of NVIDIA-specific OpenCL extension. At present, core OpenCL leaves that to the implementation to decide.