Specify different register count for kernel?

Is there a way, within a file, to tell nvcc to compile given kernel with different maximum number of registers?
There is a global parameter -maxrregcount, but I would like to apply it to only one given kernel instead of all of them within a file.

I could try to split kernels between two different files, but as not everything can be linked in CUDA, it would be somewhat complicated and would probalby introduced some unnecessary overhead.

As far as I know, you can’t and as far as I remember this was a feature request for 2.2 in previous posts opened by nVidia

for feature requests for 2.2


Interesting question…

It is supported in PTX, using the .maxnreg directive (see section 9.2 of ptx_isa_1.4.pdf).
Don’t know how to do this in C code or how to set this PTX directive in C code. Does anyone else know?

i can also see a lot of utility for this kind of a setting individually for each kernel !!

All we need is a #pragma for NVCC.