2 Replies Latest reply on Jun 28, 2013 8:29 AM by bulibuta

    clAmdBlas dimensions for transposed matrices

    bulibuta

      Hi,

       

      I decided to revisit clAmdBlas and while re-reading the docs I got a little confused in regards to dimensions.

       

      Let's take clAmdBlasDgemmEx() as an example and the following usecase: C <- A'B

       

      Now, the documentation keeps referring to the dimensions of matrix A. But Matrix A has been transposed.

      So which matrix A is the real matrix A? A or A'?

       

      I thought it would be A, but then argument K's description threw me off:

      "Number of columns in matrix A and rows in matrix B."

       

      This is clearly written for the no transpose case. Then the leading dimension bits confuse things even more, as they change their meaning depending on transposing or not. So that leads me to believe that I need to account for matrix A' not matrix A. Which is it?

       

      Could you give me a simple call example for A(m, n), B(m, p) and C(n, p) for C <- 1 * A' * B + 0 * C.

        • Re: clAmdBlas dimensions for transposed matrices
          bragadeesh

          For a regular A*B multiplication, the number of columns in A should match the number of rows in B. For transposed A, the number of rows in A must match the number of rows in B. These operations/parameters are very standard and follow NETLIB blas for the most part. Please refer to NETLIB blas (http://www.netlib.org/blas/) documentation if you need better understanding.

            • Re: clAmdBlas dimensions for transposed matrices
              bulibuta

              The parameters might be "very standard" but the blas API is not the same as the clAmdBlas one. And furthermore why bother with documenting your functions in clamdblas.refspec.pdf if they're so "very standard"?

               

              I think the documentation can be improved and instead of referring to matrix A or matrix B, you can follow BLAS's documentation and refer to them as op(A) and op(B).

               

              And if you decide to go that way, you might as well copy the text for the leading dimensions from NETLIB. It's a bit more clear on what they're supposed to be.