Further investigation showed that the problem appears because of bugs in LAPACKE interfaces for this solver but the description of array A in Reference LAPACK ?dtfsm is also wrong.
But debugging and comments in the file (see the comments on lines
361 IF( LSIDE ) THEN
362
363 SIDE = 'L'
364
365 A is M-by-M.
366 If M is odd, set NISODD = .TRUE., and M1 and M2.
367 If M is even, NISODD = .FALSE., and M. ")
in dtfsm.f shows that the size of A in the case side='L' must be NT = M*(M+1)/2
So the correct description of A must be the following:
"A [in]
A is DOUBLE PRECISION array, dimension (NT)
NT = N(N+1)/2 if SIDE='R' and NT = M(M+1)/2 otherwise . On entry, the matrix A in RFP Format. "
Checklist
[ x ] I'd be willing to make a PR to solve the LAPACKE issues reported on OneMKL forum
Description One of OneMKL customer failed to use DTFSM solver ( a triangular solver where one operand is a triangular matrix in RFP format) . The problem was reported on OneMKL forum:
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-LAPACKE-dtfsm-function/m-p/1579919
Further investigation showed that the problem appears because of bugs in LAPACKE interfaces for this solver but the description of array A in Reference LAPACK ?dtfsm is also wrong.
So the current description of A (https://www.netlib.org/lapack/explore-html/dd/d79/group__tfsm_ga8f8cf589889048a6ab91d2d4f8653aac.html) is the following "A [in] A is DOUBLE PRECISION array, dimension (NT) NT = N*(N+1)/2. On entry, the matrix A in RFP Format. "
But debugging and comments in the file (see the comments on lines
361 IF( LSIDE ) THEN 362 363 SIDE = 'L' 364 365 A is M-by-M. 366 If M is odd, set NISODD = .TRUE., and M1 and M2. 367 If M is even, NISODD = .FALSE., and M. ")
in dtfsm.f shows that the size of A in the case side='L' must be NT = M*(M+1)/2
So the correct description of A must be the following: "A [in] A is DOUBLE PRECISION array, dimension (NT) NT = N(N+1)/2 if SIDE='R' and NT = M(M+1)/2 otherwise . On entry, the matrix A in RFP Format. "
Checklist