## Transposed cases with zgetrs and cgetrs

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

### Transposed cases with zgetrs and cgetrs

The header for MAGMA zgetrs_gpu.cpp contains the following information about the definition of the character describing use of the transpose:

Code: Select all
`    TRANS   (input) CHARACTER*1            Specifies the form of the system of equations:            = 'N':  A * X = B  (No transpose)            = 'T':  A'* X = B  (Transpose)            = 'C':  A'* X = B  (Conjugate transpose = Transpose)`

The implication of this is that the Transpose and Conjugate transpose cases are the same, and this is what is implemented in the code. Unfortunately this is not the case, as is indicated by the following from the NAG description at
http://www.nag.co.uk/numeric/Fl/manual2 ... f07asf.pdf

Code: Select all
`TRANS – CHARACTER*1 InputOn entry: indicates the form of the equations as follows:if TRANS == ’N’, AX = B is solved for X;if TRANS == ’T’, ATX = B is solved for X;if TRANS == ’C’, AHX = B is solved for X.Constraint: TRANS == ’N’; ’T’ or ’C’.`

I have tested this on MAGMA zgetrs_gpu.cpp from RC4 and it is indeed incorrect.

The T and C cases are very similar and the solution is that, once the N cases has been identified, to modify the code to pass the character from the call directly to the calls to ztrsm.

Code: Select all
`       cublasZtrsm(MagmaLeft, MagmaUpper, trans, MagmaNonUnit, n, nrhs, c_one, dA, ldda, dB, lddb );        cublasZtrsm(MagmaLeft, MagmaLower, trans, MagmaUnit,    n, nrhs, c_one, dA, ldda, dB, lddb );`

I have tested this using an extension of testing_zgetrf_gpu_f.f and testing a small case which I have also solved using LAPACK.

Copies of the codes available on request.

Best wishes

John
fletchjp

Posts: 203
Joined: Mon Dec 27, 2010 7:29 pm

### Re: Transposed cases with zgetrs and cgetrs

John,

thanks for the information. I havn't seen it when it has been commited. I just corrected it and will be integrated in the next release. (I hope by the end of the week)

Mathieu
mateo70

Posts: 41
Joined: Tue Mar 08, 2011 12:38 pm

### Re: Transposed cases with zgetrs and cgetrs

Thank you I will look forward to that.

John
fletchjp

Posts: 203
Joined: Mon Dec 27, 2010 7:29 pm