Tensara Logo

tensara

Matrix Vector Multiplication

EASY

Perform multiplication of a matrix and a vector:

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

Input:

  • Matrix AA of size M×KM \times K
  • Vector BB of size K×1K \times 1

Output:

  • Vector C=ABC = AB of size M×1M \times 1

Notes:

  • Matrix A\text{A} is 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.