int index_x = blockIdx.x * blockDim.x + threadIdx.x;
int index_y = blockIdx.y * blockDim.y + threadIdx.y;
// map the two 2D indices to a single linear, 1D index
int grid_width = gridDim.x * blockDim.x;
int i = index_y * grid_width + index_x;
You must log in to send a PM.
Please Login | Register to add a comment.
Not a member? Register Now