int tidx = 0;
if (threadIdx.y == 2) { //BOXES
tidx = (((row / BOXWIDTH) * BOXWIDTH) + threadIdx.x / BOXWIDTH) * N + threadIdx.x % BOXWIDTH + (col / BOXWIDTH) * BOXWIDTH; } else if (threadIdx.y == 1) { //ROWS tidx = row * N + threadIdx.x; } else { //COLUMNS tidx = threadIdx.x * N + col; } if (control) found = true; __syncthreads(); while (found) { __syncthreads(); if (control) found = false; __syncthreads(); if (d_a[tidx] == ++guess) found = true; __syncthreads(); } /**/ if (control) d_a[row * N + col] = guess; /**/ }
/* Takes a partially filled-in grid and attempts to assign values to