# Is groupshared memory stored in L2 cache of GPU?

The article says that L1 cache is shared by work items in the same work group(aka. SM) and L2 cache is shared by different work groups.

In Direct3D, it seems that a thread group (which is specified by numthread(x, y, z)) is mapped to multi work groups, and groupshared could be accessed by all threads of the thread group (which belong to different work groups).

So, is groupshared the L2 cache of GPU? If it is, could I manipulate L1 cache directly in Direct3D?

There seems to be some confusion of terminology here. In Direct3D, you have threads and thread groups. "work item" and "work group" are generally encountered in OpenCL terminology, where a "work item" would be what a thread is in Direct3D and a "work group" corresponds to a Direct3D thread group. groupshared memory is memory accessible to all threads that are part of the same thread group.
That being said, groupshared memory is generally located in fast on-chip storage just like caches are. The whole point of groupshared memory is to take advantage of the knowledge that certain threads reside on the same part of the chip to allow them to communicate faster. And on some hardware (e.g., most of the recent NVIDIA architectures), groupshared memory and the L1 cache will actually use the same physical memory. However, that just means that one part of that memory is used as "normal" memory, accessed directly via addressing through some load-store-unit, while another part is used by the L1 cache to cache stuff…