Tensara Logo

tensara

Square Matrix Multiplication

MEDIUM

Perform multiplication of two square matrices:

C[i][j]=k=0N1A[i][k]B[k][j]C[i][j] = \sum_{k=0}^{N-1} A[i][k] \cdot B[k][j]

Input

  • Matrix AA of size N×NN \times N
  • Matrix BB of size N×NN \times N

Output

  • Matrix C=ABC = AB of size N×NN \times N

Notes:

  • All matrices A\text{A}, B\text{B}, and C\text{C} are stored in row-major order
  • This problem is adapted from KernelBench

GPU Type

Language

Data Type

Loading...

Loading editor...

CUDA C++ environment

Sample Run Results

Hit "Run" to test your code with sample inputs

Desktop Required for Code Submission

For the best coding experience, please switch to a desktop device to write and submit your solution.