BY commenting out sections of code and compiling with ptxas option to get register and memory use reported I’m gaining insight into how many registers particular sections of my code require .
The following section apparently requires 11 because without it I need only 2 but with it I need 13.
How can this code be amended to reduce the number of registers and why?
u_min[i] = u[i];
temp_u = 0.0;
temp_u = -NSYM*p[i]*vx[i]/x[i]/rho[i];
if(u[i]<0.0) u[i] = 0.0;
v_min[i] = vx[i];