Question: Write a kernel program for matrix multiplication (C=A*B). Assume that matrices are squared. Each thread in the kernel should calculate two elements of matrix
Write a kernel program for matrix multiplication (C=A*B). Assume that matrices are squared. Each thread in the kernel should calculate two elements of matrix C. For example, if dimension of the matrices is 10*10, then 50 threads are launched. Thread zero should calculate Coo and C0, thread one should calculate Co2 and C03, Assume that only one work-group is launched and the threads within the work-group are organized in one dimension. _kernel matrix_mult(const int Mdim, ____global float* A, __global float* B, _global float* C) { }
Step by Step Solution
There are 3 Steps involved in it
The kernel program is named matrixmult It takes four arguments Mdim The dimension of the matrices they are square A A pointer to the first matrix B A pointer to the second matrix C A pointer to the re... View full answer
Get step-by-step solutions from verified subject matter experts
