Is possible? How I can do it?
It’s not possible.
Caching in L2 only instead of L1 can give you some benfits if you have scattered accesses:
Global memory accesses are cached. Using the -dlcm compilation flag, they can be
configured at compile time to be cached in both L1 and L2 (-Xptxas -dlcm=ca) (this
is the default setting) or in L2 only (-Xptxas -dlcm=cg).
A cache line is 128 bytes and maps to a 128 byte aligned segment in device memory.
Memory accesses that are cached in both L1 and L2 are serviced with 128-byte memory
transactions whereas memory accesses that are cached in L2 only are serviced with
32-byte memory transactions. Caching in L2 only can therefore reduce over-fetch, for
example, in the case of scattered memory accesses."