Level-2 GEMV in cuBLAS

Let's look at how to do a GEMV matrix-vector multiplication. This is defined as the following operation for an m x n matrix A, an n-dimensional vector x, a m-dimensional vector y, and for the scalars alpha and beta:

Now let's look at how the function is laid out before we continue:

cublasSgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta, y, incy)  

Let's go through these inputs one-by-one:

  • handle refers to the cuBLAS context handle.
  • trans refers to the structure of the matrix—we can specify whether we want to use the original matrix, a direct transpose, or a conjugate transpose (for complex matrices). This ...

Get Hands-On GPU Programming with Python and CUDA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.