__global__ void add(float* a, float* b, float* c, size_t n) { size_t i = blockIdx.x * blockDim.x + threadIdx.x; if (i < n) { c[i] = a[i] + b[i]; } }