Currently static variables are allowed in device, global, and host device
functions.
A static variable in device and global functions is supposed to have
implicit device attribute. Currently it does not. This causes incorrect
diagnostics about host variables accessed by device functions.
Another issue is static device variables are allowed in host functions
since host functions could pass them to kernels for useful computations.
Currently they are not emitted in device compilation, which should be
fixed.
This patch also handles static variables in host device functions
and function scope static managed variables, and externalization
of such variables for fno-gpu-rdc case.
Nit. "This class does that" could be dropped. I'd generally follow a "<this thing> does <that> for <this reason>" structure.
E.g something along these lines: