Multiply two matrices on the GPU with one thread per output element.
Complete both functions in the starter:
std::vector<float> matmul(const std::vector<std::vector<float>>& A, const std::vector<std::vector<float>>& B): the host entry point the tests call. A is and B is with M = A.size(), K = A[0].size(), N = B[0].size(). Flatten both inputs row-major, copy them to the device, launch the kernel with a 2-D grid, and return as a flat row-major vector of length (C[row * N + col]). Return an empty vector if A is empty.__global__ void matmul_kernel(const float* A, const float* B, float* C, int M, int K, int N): works on the flattened row-major buffers. Thread (row, col) computes and must guard row < M && col < N since the grid may over-cover the matrix.The tests print the returned vector as [c0, c1, ...].