Vector addition adds matching elements from two vectors to produce a third: if A = [1, 2, 3] and B = [4, 5, 6], then C = [5, 7, 9]. section 4.4
As a parallel map, each thread handles one index: it reads A[i] and B[i], then writes their sum to C[i]. Threads work independently because no output depends on another index. section 4.6 section 4.0
C[idx] = A[idx] + B[idx];
The kernel’s essential operation adds the two inputs at the thread’s index and stores the result at that same index. section 4.6
A CUDA kernel first finds its global index and checks that it is within the vector bounds; then it performs the addition. Launch enough blocks to cover every element. section 4.6

