// BUG IN SRAD APPLICATIONS SEEMS TO BE SOMEWHERE IN THIS CODE, MEMORY CORRUPTION // srad kernel __global__ void srad2( fp d_lambda, int d_Nr, int d_Nc, long d_Ne, int *d_iN, int *d_iS, int *d_jE, int *d_jW, fp *d_dN, fp *d_dS, fp *d_dE, fp *d_dW, fp *d_c, fp *d_I){ // indexes int bx = blockIdx.x; // get current horizontal block index int tx = threadIdx.x; // get current horizontal thread index int ei = bx*NUMBER_THREADS+tx; // more threads than actual elements !!! int row; // column, x position int col; // row, y position // variables fp d_cN,d_cS,d_cW,d_cE; fp d_D; // figure out row/col location in new matrix row = (ei+1) % d_Nr - 1; // (0-n) row col = (ei+1) / d_Nr + 1 - 1; // (0-n) column if((ei+1) % d_Nr == 0){ row = d_Nr - 1; col = col - 1; } if(ei