LibDBlasF77.def.m2pp
331 lines (297 with data), 17.8 kB
DEFINITION MODULE LibDBlasF77;
(*========================================================================*)
(* HINWEIS : Bitte nur die Datei LibDBlasF77.mod.m2pp editieren *)
(*========================================================================*)
(* Es sind 2 Versionen enthalten die mit *)
(* *)
(* m2pp -D __{Parameter}__ < LibDBlasF77.mod.m2pp > LibDBlasF77.mod *)
(* *)
(* mit Parameter = {NOOPENMP|OPENMP} erzeugt werden koennen. *)
(* *)
(* NOOPENMP : "Standard" BLAS subroutinen werden genutzt *)
(* OPENMP : OpenMP parallelisiert Version von dgemm wird genutzt *)
(* *)
(* With the option OPNENMP you can request using an OpenMP parallisiezed *)
(* version of dgemm, otherwise use NOOPENMP *)
(*========================================================================*)
(* Interface to dblas level 1,2 & 3 FORTRAN 77 subroutines. *)
(* *)
(* Jack Dongarra, linpack, 3/11/78. *)
(* *)
(* To Do: Lot of other routines ;-) *)
(* *)
(* Routine provided so far are: *)
(* *)
(* Level 1 *)
(* *)
(* dnrm2 : euklidian norm of a vector *)
(* * dswap : swap two vectors *)
(* * dcopy : copy a vector to a vector *)
(* drot : plane rotation *)
(* drotg : construct givens rotation *)
(* * dscal : scale vector by a constant *)
(* * daxpy : constant times a vector plus a vector *)
(* * ddot : dot product of two vectors *)
(* * idamax : index of vector element with largest absolute value *)
(* * idamin : index of vector element with smalles absolute value *)
(* * dasum : sum of absolut values of real vector elements *)
(* *)
(* Level 3 *)
(* *)
(* sgemm : single precision matrix matrix multiplication *)
(* dgemm : double precision matrix matrix multiplication *)
(* zgemm : double complex matrix matrix multiplication *)
(* *)
(*------------------------------------------------------------------------*)
(* Last change: *)
(* *)
(* 06.09.15, MRi: First version (only ddot) *)
(* 01.12.15, MRi: Added dscal,daxpy *)
(* 02.12.15, MRi: Added dasum,dnrm2,idamax *)
(* 30.03.16, MRi: Added dswap *)
(* 15.04.16, MRi: Added dcopy,drot,drotg *)
(* Changed ARRAY OF DOUBLEPRECISION to *)
(* (* ARRAY OF *) DOUBLEPRECISION *)
(* 29.10.17, MRi: Added dgemm *)
(* 01.11.17, MRi: Added idamin *)
(* 23.06.18, MRi: Added zgemm *)
(*------------------------------------------------------------------------*)
(* Implementation : Michael Riedl *)
(* Licence : GNU Lesser General Public License (LGPL) *)
(*------------------------------------------------------------------------*)
(* $Id: LibDBlasF77.def.m2pp,v 1.1 2018/06/15 08:59:31 mriedl Exp mriedl $ *)
IMPORT LibDBlasL1F77;
IMPORT LibDBlasL3F77;
TYPE DOUBLEPRECISION = LibDBlasL1F77.DOUBLEPRECISION;
INTEGER4 = LibDBlasL1F77.INTEGER4;
CHAR1 = LibDBlasL1F77.CHAR1;
CONST dnrm2 = LibDBlasL1F77.dnrm2_;
(*
* PROCEDURE dnrm2(VAR n : INTEGER4;
* VAR X : (* ARRAY OF *) DOUBLEPRECISION;
* VAR IncX : INTEGER4): DOUBLEPRECISION;
*)
(*----------------------------------------------------------------*)
(* dnrm2 returns the euclidean norm of a vector via the function *)
(* name, so that dnrm2 := sqrt( x^{tr}*x ) *)
(*----------------------------------------------------------------*)
CONST dswap = LibDBlasL1F77.dswap_;
(*
* PROCEDURE dswap(VAR N : INTEGER4;
* VAR X : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incx : INTEGER4;
* VAR Y : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incy : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Interchanges two vectors using unrolled loops for increments *)
(* equal to 1. *)
(*----------------------------------------------------------------*)
CONST dcopy = LibDBlasL1F77.dcopy_;
(*
* PROCEDURE dcopy(VAR N : INTEGER4;
* VAR X : (* ARRAY OF *) DOUBLEPRECISION;
* VAR IncX : INTEGER4;
* VAR Y : (* ARRAY OF *) DOUBLEPRECISION;
* VAR IncY : INTEGER);
*)
(*----------------------------------------------------------------*)
(* copies a vector, x, to a vector, y. *)
(* uses unrolled loops for increments equal to one. *)
(* jack dongarra, linpack, 3/11/78. *)
(*----------------------------------------------------------------*)
CONST drot = LibDBlasL1F77.drot_;
(*
* PROCEDURE drot(VAR N : INTEGER4;
* VAR X : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incX : INTEGER4;
* VAR Y : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incY : INTEGER4;
* VAR c,s : DOUBLEPRECISION);
*)
(*---------------------------------------------------------------*)
(* Applies a plane rotation. *)
(* Jack Dongarra, linpack, 3/11/78. *)
(*---------------------------------------------------------------*)
CONST drotg = LibDBlasL1F77.drotg_;
(*
* PROCEDURE drotg(VAR da : DOUBLEPRECISION;
* VAR db : DOUBLEPRECISION;
* VAR c : DOUBLEPRECISION;
* VAR s : DOUBLEPRECISION);
*)
(*---------------------------------------------------------------*)
(* Construct a Givens plane rotation *)
(* Jack Dongarra, linpack, 3/11/78. *)
(*---------------------------------------------------------------*)
CONST dscal = LibDBlasL1F77.dscal_;
(*
* PROCEDURE dscal(VAR n : INTEGER4;
* VAR da : DOUBLEPRECISION;
* VAR dx : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incx : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Scales a vector by a constant *)
(*----------------------------------------------------------------*)
CONST daxpy = LibDBlasL1F77.daxpy_;
(*
* PROCEDURE daxpy(VAR n : INTEGER4;
* VAR da : DOUBLEPRECISION;
* VAR dx : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incx : INTEGER4;
* VAR dy : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incy : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Constant times a vector plus a vector *)
(*----------------------------------------------------------------*)
CONST ddot = LibDBlasL1F77.ddot_;
(*
* PROCEDURE ddot(VAR N : INTEGER4;
* VAR DX : (* ARRAY OF *) DOUBLEPRECISION;
* VAR INCX : INTEGER4;
* VAR DY : (* ARRAY OF *) DOUBLEPRECISION;
* VAR INCY : INTEGER4) : DOUBLEPRECISION;
*)
(*----------------------------------------------------------------*)
(* Forms the dot product of two vectors *)
(*----------------------------------------------------------------*)
CONST idamax = LibDBlasL1F77.idamax_;
(*
* PROCEDURE idamax(VAR n : INTEGER4;
* VAR dx : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incx : INTEGER4) : INTEGER4;
*)
(*----------------------------------------------------------------*)
(* Finds the index of element having max. absolute value. *)
(*----------------------------------------------------------------*)
CONST idamin = LibDBlasL1F77.idamin_;
(*
* PROCEDURE idamin(VAR n : INTEGER4;
* VAR dx : (* ARRAY OF *) DOUBLEPRECISION;
* VAR incx : INTEGER4) : INTEGER4;
*)
(*----------------------------------------------------------------*)
(* Finds the index of element having min. absolute value. *)
(*----------------------------------------------------------------*)
CONST dasum = LibDBlasL1F77.dasum_;
(*
* PROCEDURE dasum(VAR dim : INTEGER4;
* VAR X : (* ARRAY OF *) DOUBLEPRECISION;
* VAR Inc : INTEGER4) : DOUBLEPRECISION;
*)
(*----------------------------------------------------------------*)
(* Berechnet die Summe der Absolutwerte der im Feld X gespeich- *)
(* erten Zahlen. *)
(*----------------------------------------------------------------*)
CONST sgemm = LibDBlasL3F77.dgemm;
(*
* PROCEDURE sgemm( TA : CHAR1;
* TB : CHAR1;
* M,N,K : INTEGER4;
* Alpha : REAL4;
* VAR A : ARRAY OF ARRAY OF REAL4;
* lda : INTEGER4;
* VAR B : ARRAY OF ARRAY OF REAL4;
* ldb : INTEGER4;
* Beta : REAL4;
* VAR C : ARRAY OF ARRAY OF REAL4;
* ldc : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Aufruf der Fortran Version von BLAS3 subroutine sgemm *)
(* ueber Schnittstelle die fuer eine korrekte Umsetzung der *)
(* Parameter sorgt. *)
(* Durch die Schnittstelle wird auch erreicht dass die Routine *)
(* "normal" aufgerufen werden kann wie von Modula-2 her gewoehnt *)
(*----------------------------------------------------------------*)
<* IF (__OPENMP__) THEN *>
CONST dgemm = LibDBlasL3F77.dgemmOMP;
<* ELSE *>
CONST dgemm = LibDBlasL3F77.dgemm;
<* END *>
(*
* PROCEDURE dgemm( TA : CHAR1;
* TB : CHAR1;
* M,N,K : INTEGER4;
* Alpha : DOUBLEPRECISION;
* VAR A : ARRAY OF ARRAY OF DOUBLEPRECISION;
* lda : INTEGER4;
* VAR B : ARRAY OF ARRAY OF DOUBLEPRECISION;
* ldb : INTEGER4;
* Beta : DOUBLEPRECISION;
* VAR C : ARRAY OF ARRAY OF DOUBLEPRECISION;
* ldc : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Aufruf der Fortran Version von BLAS3 subroutine dgemm *)
(* ueber Schnittstelle die fuer eine korrekte Umsetzung der *)
(* Parameter sorgt. *)
(* Durch die Schnittstelle wird auch erreicht dass die Routine *)
(* "normal" aufgerufen werden kann wie von Modula-2 her gewoehnt *)
(* *)
(* Real matrix matrix multiplication routine *)
(* *)
(* TA : Specifies whether to transpose matrix A *)
(* TB : Specifies whether to transpose matrix B *)
(* M : Number of rows in matrices A and C *)
(* N : Number of columns in matrices B and C *)
(* K : Number of columns in matrix A; number of rows in *)
(* matrix B *)
(* Alpha : Scaling factor for the product of matrices A and B *)
(* A : Matrix A *)
(* lda : The size of the first dimention of matrix A, if *)
(* passing a matrix A[m,n], the value should be m *)
(* B : Matrix B *)
(* ldb : The size of the first dimention of matrix B, if *)
(* passing a matrix B[m,n], the value should be m *)
(* Beta : Scaling factor for matrix C *)
(* C : Resulting matrix C *)
(* ldb : The size of the first dimention of matrix C, if *)
(* passing a matrix C[m,n], the value should be m *)
(*----------------------------------------------------------------*)
CONST zgemm = LibDBlasL3F77.zgemm;
(*
* PROCEDURE zgemm( TA : CHAR1;
* TB : CHAR1;
* M,N,K : INTEGER4;
* Alpha : DOUBLECOMPLEX;
* VAR A : ARRAY OF ARRAY OF DOUBLECOMPLEX;
* lda : INTEGER4;
* VAR B : ARRAY OF ARRAY OF DOUBLECOMPLEX;
* ldb : INTEGER4;
* Beta : DOUBLECOMPLEX;
* VAR C : ARRAY OF ARRAY OF DOUBLECOMPLEX;
* ldc : INTEGER4);
*)
(*----------------------------------------------------------------*)
(* Aufruf der Fortran Version von BLAS3 subroutine zgemm *)
(* ueber Schnittstelle die fuer eine korrekte Umsetzung der *)
(* Parameter sorgt. *)
(* Durch die Schnittstelle wird auch erreicht dass die Routine *)
(* "normal" aufgerufen werden kann wie von Modula-2 her gewoehnt *)
(* *)
(* Complex matrix matrix multiplication routine *)
(* *)
(* TA : Specifies whether to transpose matrix A (option "T") *)
(* or not (option "N") or use the complex conjugate of *)
(* the transpose of A (option "T", op(A) = conj(A')) *)
(* TB : Same as TA for matrix B *)
(* M : Number of rows in matrices A and C *)
(* N : Number of columns in matrices B and C *)
(* K : Number of columns in matrix A; number of rows in *)
(* matrix B *)
(* Alpha : Scaling factor for the product of matrices A and B *)
(* A : Matrix A *)
(* lda : The size of the first dimention of matrix A, if *)
(* passing a matrix A[m,n], the value should be m *)
(* B : Matrix B *)
(* ldb : The size of the first dimention of matrix B, if *)
(* passing a matrix B[m,n], the value should be m *)
(* Beta : Scaling factor for matrix C *)
(* C : Resulting matrix C *)
(* ldb : The size of the first dimention of matrix C, if *)
(* passing a matrix C[m,n], the value should be m *)
(*----------------------------------------------------------------*)
END LibDBlasF77.