A grid is the collection of thread blocks created by one CUDA kernel launch. Think of a school: the grid is the whole school, each block is a classroom, and each thread is a student. Every thread belongs to one block, and every block belongs to the grid. section 3.2
myKernel<<<4, 256>>>(); // 4 classrooms, 256 students each
This launch creates a grid of 4 blocks, with 256 threads in each block. section 3.2
Blocks are scheduled on streaming multiprocessors (SMs), and extra blocks wait until an SM is free. Blocks may run in any order, so don’t make one block depend on another finishing first. For array work, calculate each thread’s global index and check that it is within the array bounds before accessing an element. section 3.2 section 3.16


