Add two matrices element-wise on the GPU using a 2D grid of threads, one thread per element.
Implement both functions from the starter:
__global__ void matadd_kernel(const float* A, const float* B, float* C, int rows, int cols): A, B, C are device arrays holding the matrices flattened in row-major order (element (r, c) at r * cols + c). Each thread derives its (row, col) from the 2D block and thread indices, checks row < rows && col < cols, and writes C[row*cols + col] = A[row*cols + col] + B[row*cols + col].std::vector<float> matrix_add(const std::vector<std::vector<float>>& A, const std::vector<std::vector<float>>& B): the host entry point the tests call. A and B are rows x cols matrices of the same shape, given as vectors of rows. Flatten them row-major, copy to the device, launch matadd_kernel with a 2D grid that covers every element (for example dim3 block(16, 16)), copy the result back, and return it as a std::vector<float> of length rows * cols in row-major order (row 0 first). Return an empty vector when A has no rows.