We want to do a Matrix Vector multiplication of a bandmatrix, using cublasSgbmv from the Cublas library. The results we get are not as expected, so we’re probably doing something wrong.
It’s not completely clear to us from the documentation what the expected memory layout of the input matrix A is.
First question: Is the expected memory layout of matrix A, row major or column major. Since this is a C library, we would expect row major, however, since the library is based on a Fortran library, it could also be column major.
Second, the description says that the matrix should be supplied column by column.
As we understand it, the rows of the marix have to contain the diagonals and the columns should contain the elements from each diagonal.
For instance, we have a matrix with 3 super diagonals and 3 sub diagonals. The input matrix then looks as follows:
col 0, 1, 2, 3, 4, 5, n - 1 row 0, u3 row 1, u2 row 2, u1 row 3, d row 4, l1 row 5, l2 row 6, l3
Is this correct?
And finally a question about the parameter m, which has to contain the number of rows of matrix A. In this case, the number of rows equals the number of bands + 1, so 7. Or should this be the number of rows of the original full matrix?
Thanks in advance,