Open main menu

CDOT Wiki β

Changes

TriForce

103 bytes added, 17:08, 15 March 2019
Assignment 2
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