1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 17:03:43 +02:00

Fixed DGEMM

This commit is contained in:
Anthony Scemama 2021-10-14 21:53:00 +02:00
parent b3e3b0b6dc
commit 1a713455f8

View File

@ -23,7 +23,8 @@ int main() {
** ~qmckl_dgemm~ ** ~qmckl_dgemm~
Matrix multiply l$C_{ij} = \beta C_{ij} + \alpha \sum_{k} A_{ik} \cdot B_{kj}$ using Fortran ~matmul~ function. Matrix multiply: $C_{ij} = \beta C_{ij} + \alpha \sum_{k} A_{ik} \cdot B_{kj}$ using Fortran ~matmul~ function.
TODO: Add description about the external library dependence. TODO: Add description about the external library dependence.
#+NAME: qmckl_dgemm_args #+NAME: qmckl_dgemm_args
@ -161,11 +162,23 @@ integer function qmckl_dgemm_f(context, TransA, TransB, m, n, k, alpha, A, LDA,
endif endif
if (TransA) then if (TransA) then
C = matmul(AT,B) if (alpha == 1.d0 && beta == 0.d0) then
C = matmul(AT,B)
else
C = beta*C + alpha*matmul(AT,B)
endif
else if (TransB) then else if (TransB) then
C = matmul(A,BT) if (alpha == 1.d0 && beta == 0.d0) then
C = matmul(A,BT)
else
C = beta*C + alpha*matmul(A,BT)
endif
else else
C = matmul(A,B) if (alpha == 1.d0 && beta == 0.d0) then
C = matmul(A,B)
else
C = beta*C + alpha*matmul(A,B)
endif
endif endif
end function qmckl_dgemm_f end function qmckl_dgemm_f
#+end_src #+end_src