 # cublasStrsm Bug report

Hi all. I’ve got wrong result of this function when I’m using it with Upper nonunit triangular matrix (when I use it with lower triangular matrix evrything is fine).

The coefficient matrix is:

2.45 1.63 2.04

0 0.58 1.15

0 0 0.71

and right side vector is:

11.84 4.62 2.12

But the result I’ve got is:

4.833 8.000 2.999

My call is:

``````cublasStrsm('l','u','t','n', dimA, 1, 1.0, d_A, dimA, d_S, dimA);
``````

I use ‘t’ because I save matrix in row-major order.

And when I try call it in such way:

``````cublasStrsm('l','u','n','n', dimA, 1, 1.0, d_A, dimA, d_S, dimA);
``````

I got the same result.

The same situation with cublasStrsv.

So I transpose matrix before cublasStrsm call and then call it in such way:

``````cublasStrsm('l','u','n','n', dimA, 1, 1.0, d_A, dimA, d_S, dimA);
``````

And I’ve got the right answer!

So obviously in your cublas code you make a mistake and matrix transpose specifier doesn’t make rigth function in those functions :( .

OS version WinXPSP2

Toolkit - 1.0

SDK - 1.0

GPU 8600GT

And one more: is there any restrictions on matrix dimension for cublasStrsv, cublasStpsv and cublasStrsm?

1. When passing in A in row-major storage order, the non-zero coefficients are going to be in the lower triangular matrix.

The uplo parameter describes where the non-zero elements are stored.

Consequently, uplo must be set to ‘l’, not ‘u’. The call when using row-major A thus becomes:

cublasStrsm(‘l’,‘l’,‘t’,‘n’, dimA, 1, 1.0, d_A, dimA, d_S, dimA);

which produces the correct X: transpose(0.985759 2.04517 2.98592)

(2) STRSV and STPSV require n <= 4070, as specified in the CUBLAS documentation. STRSM has no size limitations.

Thank you. It was my mistake. Now I find in strsm description your answer. But in other cases just said “uplo specifies whether the matrix is an upper or lower triangular matrix” and any word about data presentation :(