Tensara Logo

tensara

3D Tensor-Matrix Multiplication

HARD

Perform 3D tensor-matrix multiplication of two tensors:

C[i][j][l]=k=0K1A[i][j][k]B[k][l]C[i][j][l] = \sum_{k=0}^{K-1} A[i][j][k] \cdot B[k][l]

Input

  • Tensor AA of size N×M×KN \times M \times K
  • Matrix BB of size K×LK \times L

Output

  • Tensor CC of size N×M×LN \times M \times L

Notes:

  • All tensors 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.