title: Utilizing Register memory in CUDA
body: <p>I have some questions regarding cuda registers memory</p>
  
  <p>1) Is there any way to free registers in cuda kernel? I have variables, 1D and 2D arrays in registers. (max array size 48)</p>
  
  <p>2) If I use <strong>device</strong> functions, then what happens to the registers I used in device function after its execution? Will they be available for calling kernel execution or other device functions?</p>
  
  <p>3) How nvcc optimizes register usage? Please share the points important w.r.t optimization of memory intensive kernel </p>
  
  <p>PS: I have a complex algorithm to port to cuda which is taking a lot of registers for computation, I am trying to figure out whether to store intermediate data in register and write one kernel or store it in global memory and break algorithm in multiple kernels. </p>