Open main menu

CDOT Wiki β

Changes

TriForce

21 bytes added, 17:05, 15 March 2019
Assignment 2
// Checks whether it will be legal to assign num to the given row, col
__global__ void makeGuess(int* d_a, int guess, int row, int col) {
__shared__ bool found; bool control = !(threadIdx.x || threadIdx.y); 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;
}