Propagate number of variables as template parameter:

- this allows the CUDA compiler to optimize kernels