123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- /*
- * -- High Performance Computing Linpack Benchmark (HPL)
- * HPL - 2.0 - September 10, 2008
- * Antoine P. Petitet
- * University of Tennessee, Knoxville
- * Innovative Computing Laboratory
- * (C) Copyright 2000-2008 All Rights Reserved
- *
- * -- Copyright notice and Licensing terms:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions, and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgement:
- * This product includes software developed at the University of
- * Tennessee, Knoxville, Innovative Computing Laboratory.
- *
- * 4. The name of the University, the name of the Laboratory, or the
- * names of its contributors may not be used to endorse or promote
- * products derived from this software without specific written
- * permission.
- *
- * -- Disclaimer:
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- #ifndef HPL_BLAS_H
- #define HPL_BLAS_H
- /*
- * ---------------------------------------------------------------------
- * Include files
- * ---------------------------------------------------------------------
- */
- #include "hpl_misc.h"
- #include "mkl_blas.h"
- /*
- * ---------------------------------------------------------------------
- * typedef definitions
- * ---------------------------------------------------------------------
- */
- enum HPL_ORDER
- { HplRowMajor = 101, HplColumnMajor = 102 };
- enum HPL_TRANS
- { HplNoTrans = 111, HplTrans = 112, HplConjTrans = 113 };
- enum HPL_UPLO
- { HplUpper = 121, HplLower = 122 };
- enum HPL_DIAG
- { HplNonUnit = 131, HplUnit = 132 };
- enum HPL_SIDE
- { HplLeft = 141, HplRight = 142 };
- #ifdef HPL_CALL_CBLAS
- /*
- * ---------------------------------------------------------------------
- * The C interface of the BLAS is available ...
- * ---------------------------------------------------------------------
- * #define macro constants
- * ---------------------------------------------------------------------
- */
- #define CBLAS_INDEX int
-
- #define CBLAS_ORDER HPL_ORDER
- #define CblasRowMajor HplRowMajor
- #define CblasColMajor HplColMajor
-
- #define CBLAS_TRANSPOSE HPL_TRANS
- #define CblasNoTrans HplNoTrans
- #define CblasTrans HplTrans
- #define CblasConjTrans HplConjTrans
-
- #define CBLAS_UPLO HPL_UPLO
- #define CblasUpper HplUpper
- #define CblasLower HplLower
-
- #define CBLAS_DIAG HPL_DIAG
- #define CblasNonUnit HplNonUnit
- #define CblasUnit HplUnit
-
- #define CBLAS_SIDE HPL_SIDE
- #define CblasLeft HplLeft
- #define CblasRight HplRight
- /*
- * ---------------------------------------------------------------------
- * CBLAS Function prototypes
- * ---------------------------------------------------------------------
- */
- CBLAS_INDEX cblas_idamax
- STDC_ARGS(
- ( const int, const double *, const int ) );
- void cblas_dswap
- STDC_ARGS(
- ( const int, double *, const int, double *,
- const int ) );
- void cblas_dcopy
- STDC_ARGS(
- ( const int, const double *, const int, double *,
- const int ) );
- void cblas_daxpy
- STDC_ARGS(
- ( const int, const double, const double *, const int,
- double *, const int ) );
- void cblas_dscal
- STDC_ARGS(
- ( const int, const double, double *, const int ) );
- void cblas_dgemv
- STDC_ARGS(
- ( const enum CBLAS_ORDER, const enum CBLAS_TRANSPOSE,
- const int, const int, const double, const double *,
- const int, const double *, const int, const double,
- double *, const int ) );
- void cblas_dger
- STDC_ARGS(
- ( const enum CBLAS_ORDER, const int, const int,
- const double, const double *, const int, const double *,
- const int, double *, const int ) );
- void cblas_dtrsv
- STDC_ARGS(
- ( const enum CBLAS_ORDER, const enum CBLAS_UPLO,
- const enum CBLAS_TRANSPOSE, const enum CBLAS_DIAG,
- const int, const double *, const int, double *,
- const int ) );
- void cblas_dgemm
- STDC_ARGS(
- ( const enum CBLAS_ORDER, const enum CBLAS_TRANSPOSE,
- const enum CBLAS_TRANSPOSE, const int, const int,
- const int, const double, const double *, const int,
- const double *, const int, const double, double *,
- const int ) );
- void cblas_dtrsm
- STDC_ARGS(
- ( const enum CBLAS_ORDER, const enum CBLAS_SIDE,
- const enum CBLAS_UPLO, const enum CBLAS_TRANSPOSE,
- const enum CBLAS_DIAG, const int, const int,
- const double, const double *, const int, double *,
- const int ) );
- /*
- * ---------------------------------------------------------------------
- * HPL C BLAS macro definition
- * ---------------------------------------------------------------------
- */
- #define HPL_dswap cblas_dswap
- #define HPL_dcopy cblas_dcopy
- #define HPL_daxpy cblas_daxpy
- #define HPL_dscal cblas_dscal
- #define HPL_idamax cblas_idamax
- #define HPL_dgemv cblas_dgemv
- #define HPL_dtrsv cblas_dtrsv
- #define HPL_dger cblas_dger
- #define HPL_dgemm cblas_dgemm
- #define HPL_dtrsm cblas_dtrsm
- #endif
- #ifdef HPL_CALL_FBLAS
- /*
- * ---------------------------------------------------------------------
- * Use the Fortran 77 interface of the BLAS ...
- * ---------------------------------------------------------------------
- * Defaults: Add_, F77_INTEGER=int, StringSunStyle
- * ---------------------------------------------------------------------
- */
- #ifndef NoChange
- #ifndef UpCase
- #ifndef Add__
- #ifndef Add_
- #define Add_
- #endif
- #endif
- #endif
- #endif
- #ifndef F77_INTEGER
- #define F77_INTEGER int
- #else
- #define HPL_USE_F77_INTEGER_DEF
- #endif
- #ifndef StringCrayStyle
- #ifndef StringStructVal
- #ifndef StringStructPtr
- #ifndef StringSunStyle
- #define StringSunStyle
- #endif
- #endif
- #endif
- #endif
- /*
- * ---------------------------------------------------------------------
- * Fortran 77 <-> C interface
- * ---------------------------------------------------------------------
- *
- * These macros identifies how Fortran routines will be called.
- *
- * Add_ : the Fortran compiler expects the name of C functions to be
- * in all lower case and to have an underscore postfixed it (Suns, Intel
- * compilers expect this).
- *
- * NoChange : the Fortran compiler expects the name of C functions to be
- * in all lower case (IBM RS6K compilers do this).
- *
- * UpCase : the Fortran compiler expects the name of C functions to be
- * in all upcase. (Cray compilers expect this).
- *
- * Add__ : the Fortran compiler in use is f2c, a Fortran to C conver-
- * ter.
- */
- #ifdef NoChange
- /*
- * These defines set up the naming scheme required to have a FORTRAN
- * routine called by a C routine with the following FORTRAN to C inter-
- * face:
- *
- * FORTRAN DECLARATION C CALL
- * SUBROUTINE DGEMM(...) dgemm(...)
- */
- #define F77dswap dswap
- #define F77dscal dscal
- #define F77dcopy dcopy
- #define F77daxpy daxpy
- #define F77idamax idamax
- #define F77dgemv dgemv
- #define F77dtrsv dtrsv
- #define F77dger dger
- #define F77dgemm dgemm
- #define F77dtrsm dtrsm
- #endif
- #ifdef UpCase
- /*
- * These defines set up the naming scheme required to have a FORTRAN
- * routine called by a C routine with the following FORTRAN to C inter-
- * face:
- *
- * FORTRAN DECLARATION C CALL
- * SUBROUTINE DGEMM(...) DGEMM(...)
- */
- #ifdef CRAY_BLAS
-
- #define F77dswap SSWAP
- #define F77dscal SSCAL
- #define F77dcopy SCOPY
- #define F77daxpy SAXPY
- #define F77idamax ISAMAX
-
- #define F77dgemv SGEMV
- #define F77dtrsv STRSV
- #define F77dger SGER
-
- #define F77dgemm SGEMM
- #define F77dtrsm STRSM
-
- #else
- #define F77dswap DSWAP
- #define F77dscal DSCAL
- #define F77dcopy DCOPY
- #define F77daxpy DAXPY
- #define F77idamax IDAMAX
- #define F77dgemv DGEMV
- #define F77dtrsv DTRSV
- #define F77dger DGER
- #define F77dgemm DGEMM
- #define F77dtrsm DTRSM
- #endif
- #endif
- #ifdef Add_
- /*
- * These defines set up the naming scheme required to have a FORTRAN
- * routine called by a C routine with the following FORTRAN to C inter-
- * face:
- *
- * FORTRAN DECLARATION C CALL
- * SUBROUTINE DGEMM(...) dgemm_(...)
- */
- #define F77dswap dswap_
- #define F77dscal dscal_
- #define F77dcopy dcopy_
- #define F77daxpy daxpy_
- #define F77idamax idamax_
- #define F77dgemv dgemv_
- #define F77dtrsv dtrsv_
- #define F77dger dger_
- #define F77dgemm dgemm_
- #define F77dtrsm dtrsm_
- #endif
- #ifdef Add__
- /*
- * These defines set up the naming scheme required to have a FORTRAN
- * routine called by a C routine with the following FORTRAN to C inter-
- * face:
- *
- * FORTRAN DECLARATION C CALL
- * SUBROUTINE DGEMM(...) dgemm_(...)
- */
- #define F77dswap dswap_
- #define F77dscal dscal_
- #define F77dcopy dcopy_
- #define F77daxpy daxpy_
- #define F77idamax idamax_
-
- #define F77dgemv dgemv_
- #define F77dtrsv dtrsv_
- #define F77dger dger_
-
- #define F77dgemm dgemm_
- #define F77dtrsm dtrsm_
-
- #endif
- /*
- * ---------------------------------------------------------------------
- * Typedef definitions and conversion utilities
- * ---------------------------------------------------------------------
- */
- #ifdef StringCrayStyle
- #include <fortran.h>
- /* Type of character argument in a FORTRAN call */
- #define F77_CHAR _fcd
- /* Character conversion utilities */
- #define HPL_F2C_CHAR(c) (*(_fcdtocp(c) ))
- #define HPL_C2F_CHAR(c) (_cptofcd(&(c), 1))
- #define F77_CHAR_DECL F77_CHAR /* input CHARACTER*1 */
- #endif
- /* ------------------------------------------------------------------ */
- #ifdef StringStructVal
- /* Type of character argument in a FORTRAN call */
- typedef struct { char *cp; F77_INTEGER len; } F77_CHAR;
- /* Character conversion utilities */
- #define HPL_F2C_CHAR(c) (*(c.cp))
- #define F77_CHAR_DECL F77_CHAR /* input CHARACTER*1 */
- #endif
- /* ------------------------------------------------------------------ */
- #ifdef StringStructPtr
- /* Type of character argument in a FORTRAN call */
- typedef struct { char *cp; F77_INTEGER len; } F77_CHAR;
- /* Character conversion utilities */
- #define HPL_F2C_CHAR(c) (*(c->cp))
- #define F77_CHAR_DECL F77_CHAR * /* input CHARACTER*1 */
- #endif
- /* ------------------------------------------------------------------ */
- #ifdef StringSunStyle
- /* Type of character argument in a FORTRAN call */
- #define F77_CHAR char *
- /* Character conversion utilities */
- #define HPL_F2C_CHAR(c) (*(c))
- #define HPL_C2F_CHAR(c) (&(c))
- #define F77_CHAR_DECL F77_CHAR /* input CHARACTER*1 */
- #define F77_1_CHAR , F77_INTEGER
- #define F77_2_CHAR F77_1_CHAR F77_1_CHAR
- #define F77_3_CHAR F77_2_CHAR F77_1_CHAR
- #define F77_4_CHAR F77_3_CHAR F77_1_CHAR
- #endif
- /* ------------------------------------------------------------------ */
- #ifndef F77_1_CHAR
- #define F77_1_CHAR
- #define F77_2_CHAR
- #define F77_3_CHAR
- #define F77_4_CHAR
- #endif
- #define F77_INT_DECL const F77_INTEGER * /* input integer */
- #define F77_SIN_DECL const double * /* input scalar */
- #define F77_VIN_DECL const double * /* input vector */
- #define F77_VINOUT_DECL double * /* input/output matrix */
- #define F77_MIN_DECL const double * /* input matrix */
- #define F77_MINOUT_DECL double * /* input/output matrix */
-
- #ifdef CRAY_PVP_ENV /* Type of FORTRAN functions */
- #define F77_VOID_FUN extern fortran void /* subroutine */
- #define F77_INT_FUN extern fortran int /* integer function */
- #else
- #define F77_VOID_FUN extern void /* subroutine */
- #define F77_INT_FUN extern int /* integer function */
- #endif
- /*
- * ---------------------------------------------------------------------
- * Fortran 77 BLAS function prototypes
- * ---------------------------------------------------------------------
- */
- F77_VOID_FUN F77dswap
- STDC_ARGS(
- ( F77_INT_DECL, F77_VINOUT_DECL, F77_INT_DECL, F77_VINOUT_DECL,
- F77_INT_DECL ) );
- F77_VOID_FUN F77dscal
- STDC_ARGS(
- ( F77_INT_DECL, F77_SIN_DECL, F77_VINOUT_DECL, F77_INT_DECL ) );
- F77_VOID_FUN F77dcopy
- STDC_ARGS(
- ( F77_INT_DECL, F77_VIN_DECL, F77_INT_DECL, F77_VINOUT_DECL,
- F77_INT_DECL ) );
- F77_VOID_FUN F77daxpy
- STDC_ARGS(
- ( F77_INT_DECL, F77_SIN_DECL, F77_VIN_DECL, F77_INT_DECL,
- F77_VINOUT_DECL, F77_INT_DECL ) );
- F77_INT_FUN F77idamax
- STDC_ARGS(
- ( F77_INT_DECL, F77_VIN_DECL, F77_INT_DECL ) );
- F77_VOID_FUN F77dgemv
- STDC_ARGS(
- ( F77_CHAR_DECL, F77_INT_DECL, F77_INT_DECL, F77_SIN_DECL,
- F77_MIN_DECL, F77_INT_DECL, F77_VIN_DECL, F77_INT_DECL,
- F77_SIN_DECL, F77_VINOUT_DECL, F77_INT_DECL F77_1_CHAR ) );
- F77_VOID_FUN F77dger
- STDC_ARGS(
- ( F77_INT_DECL, F77_INT_DECL, F77_SIN_DECL, F77_VIN_DECL,
- F77_INT_DECL, F77_VIN_DECL, F77_INT_DECL, F77_MINOUT_DECL,
- F77_INT_DECL ) );
- F77_VOID_FUN F77dtrsv
- STDC_ARGS(
- ( F77_CHAR_DECL, F77_CHAR_DECL, F77_CHAR_DECL, F77_INT_DECL,
- F77_MIN_DECL, F77_INT_DECL, F77_VINOUT_DECL, F77_INT_DECL
- F77_3_CHAR ) );
- F77_VOID_FUN F77dgemm
- STDC_ARGS(
- ( F77_CHAR_DECL, F77_CHAR_DECL, F77_INT_DECL, F77_INT_DECL,
- F77_INT_DECL, F77_SIN_DECL, F77_MIN_DECL, F77_INT_DECL,
- F77_MIN_DECL, F77_INT_DECL, F77_SIN_DECL, F77_MINOUT_DECL,
- F77_INT_DECL F77_2_CHAR ) );
- F77_VOID_FUN F77dtrsm
- STDC_ARGS(
- ( F77_CHAR_DECL, F77_CHAR_DECL, F77_CHAR_DECL, F77_CHAR_DECL,
- F77_INT_DECL, F77_INT_DECL, F77_SIN_DECL, F77_MIN_DECL,
- F77_INT_DECL, F77_MINOUT_DECL, F77_INT_DECL F77_4_CHAR ) );
- #endif
- /*
- * ---------------------------------------------------------------------
- * HPL BLAS Function prototypes
- * ---------------------------------------------------------------------
- */
- #ifndef HPL_CALL_CBLAS
- int HPL_idamax
- STDC_ARGS( (
- const int,
- const double *,
- const int
- ) );
- void HPL_daxpy
- STDC_ARGS( (
- const int,
- const double,
- const double *,
- const int,
- double *,
- const int
- ) );
- void HPL_dcopy
- STDC_ARGS( (
- const int,
- const double *,
- const int,
- double *,
- const int
- ) );
- void HPL_dscal
- STDC_ARGS( (
- const int,
- const double,
- double *,
- const int
- ) );
- void HPL_dswap
- STDC_ARGS( (
- const int,
- double *,
- const int,
- double *,
- const int
- ) );
- void HPL_dgemv
- STDC_ARGS( (
- const enum HPL_ORDER,
- const enum HPL_TRANS,
- const int,
- const int,
- const double,
- const double *,
- const int,
- const double *,
- const int,
- const double,
- double *,
- const int
- ) );
- void HPL_dger
- STDC_ARGS( (
- const enum HPL_ORDER,
- const int,
- const int,
- const double,
- const double *,
- const int,
- double *,
- const int,
- double *,
- const int
- ) );
- void HPL_dtrsv
- STDC_ARGS( (
- const enum HPL_ORDER,
- const enum HPL_UPLO,
- const enum HPL_TRANS,
- const enum HPL_DIAG,
- const int,
- const double *,
- const int,
- double *,
- const int
- ) );
- void HPL_dgemm
- STDC_ARGS( (
- const enum HPL_ORDER,
- const enum HPL_TRANS,
- const enum HPL_TRANS,
- const int,
- const int,
- const int,
- const double,
- const double *,
- const int,
- const double *,
- const int,
- const double,
- double *,
- const int
- ) );
- void HPL_dtrsm
- STDC_ARGS( (
- const enum HPL_ORDER,
- const enum HPL_SIDE,
- const enum HPL_UPLO,
- const enum HPL_TRANS,
- const enum HPL_DIAG,
- const int,
- const int,
- const double,
- const double *,
- const int,
- double *,
- const int
- ) );
- #endif
- #endif
- /*
- * hpl_blas.h
- */
|