When we compile PTX code using the PTX compiler library, we can set, separately, the maximum number of registers for use by a non-kernel GPU-side function ("device-side" function), and by a kernel.
Now, when we compile PTX using the CUDA driver only, with cuLinkAddData() we have an option, CU_JIT_MAX_REGISTERS, whose documentation describes as:
Max number of registers that a thread may use. Option type: unsigned int Applies to: compiler only
So, is that a thread in a kernel? In a device function? Both?