Code inspection: A memory space local variable must be 'extern' or 'static'
This inspection reports an automatic local variable declared with one of the CUDA memory space specifiers __device__, __constant__, __managed__, or __tile__. A local variable with these specifiers needs to be extern or static.
Example
__device__ void process()
{
__device__ int cache;
}
__device__ void process()
{
static __device__ int cache;
}
If you need a local variable shared by all threads of a block in device code, use __shared__.
27 October 2026