/* ---------------------------------------------------------------------
*
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
* -- ATLAS routine -- Version 3.2 -- December 25, 2000
*
* Author : Antoine P. Petitet
* Originally developed at the University of Tennessee,
* Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
* -- 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 distri-
* bution.
* 3. The name of the University, the ATLAS group, or the names of its
* contributors may not be used to endorse or promote products deri-
* ved 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, SPE-
* CIAL, 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 THEO-
* RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
* CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ---------------------------------------------------------------------
*/
#ifndef ATLAS_F77WRAP_H
#define ATLAS_F77WRAP_H
/*
* =====================================================================
* Include Files
* =====================================================================
*/
#include "atlas_misc.h"
#include "atlas_f77.h"
/*
* =====================================================================
* Multi-threaded/reference implementation function names re-definition
* =====================================================================
*
* Uncomment the following definition macros to call the multi-threaded
* implementation or define those macros at compile time.
*
* #define USE_L1_PTHREADS
* #define USE_L2_PTHREADS
* #define USE_L3_PTHREADS
*
* Uncomment the following definition macros to call the reference im-
* plementation or define those macros at compile time.
*
* #define USE_L1_REFERENCE
* #define USE_L2_REFERENCE
* #define USE_L3_REFERENCE
*
* =====================================================================
*/
#ifdef ATL_USEPTHREADS
#define USE_L3_PTHREADS
#endif
/*
* =====================================================================
* ATLAS Levels 1, 2 and 3 Prototypes
* =====================================================================
*/
#if defined( USE_L1_PTHREADS )
#include "atlas_ptalias1.h"
#include "atlas_ptlevel1.h"
#elif defined( USE_L1_REFERENCE )
#include "atlas_refalias1.h"
#include "atlas_reflevel1.h"
#else
#include "atlas_level1.h"
#endif
#if defined( USE_L2_PTHREADS )
#include "atlas_ptalias2.h"
#include "atlas_ptlevel2.h"
#elif defined( USE_L2_REFERENCE )
#include "atlas_refalias2.h"
#include "atlas_reflevel2.h"
#else
#include "atlas_level2.h"
#endif
#if defined( USE_L3_PTHREADS )
#include "atlas_ptalias3.h"
#include "atlas_ptlevel3.h"
#elif defined( USE_L3_REFERENCE )
#include "atlas_refalias3.h"
#include "atlas_reflevel3.h"
#else
#include "atlas_level3.h"
#endif
/*
* =====================================================================
* #define macro constants
* =====================================================================
*/
#define PATLF77WRAP Mjoin( ATL_F77wrap_, PRE )
#ifdef TREAL
#define ATLPUF77WRAP Mjoin( ATL_F77wrap_, PRE )
#define ATLUPF77WRAP Mjoin( ATL_F77wrap_, PRE )
#else
#define ATLPUF77WRAP Mjoin( Mjoin( ATL_F77wrap_, PRE ), UPR )
#define ATLUPF77WRAP Mjoin( Mjoin( ATL_F77wrap_, UPR ), PRE )
#endif
#define F77_INOTRAN 111
#define F77_ITRAN 112
#define F77_ICOTRAN 113
#define F77_IUPPER 121
#define F77_ILOWER 122
#define F77_INONUNIT 131
#define F77_IUNIT 132
#define F77_ILEFT 141
#define F77_IRIGHT 142
/*
* =====================================================================
* #define macro functions
* =====================================================================
*/
#ifdef TREAL
#define V1N( n_, x_, incx_ ) \
( (*n_) > 0 ? (x_)+(1-(*n_))*(*incx_) : (x_) )
#define VN1( n_, x_, incx_ ) \
( (*n_) > 0 ? (x_)+((*n_)-1)*(*incx_) : (x_) )
#define W1N( n_, x_, incx_ ) \
( (*incx_) < 0 ? V1N( n_, x_, incx_ ) : (x_) )
#else
#define V1N( n_, x_, incx_ ) \
( (*n_) > 0 ? (x_)+( ( (1-(*n_))*(*incx_) ) << 1 ) : (x_) )
#define VN1( n_, x_, incx_ ) \
( (*n_) > 0 ? (x_)+( ( ((*n_)-1)*(*incx_) ) << 1 ) : (x_) )
#define W1N( n_, x_, incx_ ) \
( (*incx_) < 0 ? V1N( n_, x_, incx_ ) : (x_) )
#endif
/*
* =====================================================================
* FORTRAN <-> C interface
* =====================================================================
*
* These macros identifies how these wrappers will be called as follows:
*
* 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.
*/
#if defined( Add_ )
/*
* These defines set up the naming scheme required to have a FORTRAN
* routine calling a C routine.
*
* FORTRAN CALL C declaration
* CALL ATL_F77WRAP_SGEMM(...) void atl_f77wrap_sgemm_(...)
*
* This is the default.
*/
#if defined( SREAL )
#define ATL_F77wrap_srotg atl_f77wrap_srotg_
#define ATL_F77wrap_srotmg atl_f77wrap_srotmg_
#define ATL_F77wrap_snrm2 atl_f77wrap_snrm2_
#define ATL_F77wrap_sasum atl_f77wrap_sasum_
#define ATL_F77wrap_sscal atl_f77wrap_sscal_
#define ATL_F77wrap_isamax atl_f77wrap_isamax_
#define ATL_F77wrap_saxpy atl_f77wrap_saxpy_
#define ATL_F77wrap_scopy atl_f77wrap_scopy_
#define ATL_F77wrap_sswap atl_f77wrap_sswap_
#define ATL_F77wrap_srot atl_f77wrap_srot_
#define ATL_F77wrap_srotm atl_f77wrap_srotm_
#define ATL_F77wrap_sdot atl_f77wrap_sdot_
#define ATL_F77wrap_dsdot atl_f77wrap_dsdot_
#define ATL_F77wrap_sdsdot atl_f77wrap_sdsdot_
#define ATL_F77wrap_sgbmv atl_f77wrap_sgbmv_
#define ATL_F77wrap_sgemv atl_f77wrap_sgemv_
#define ATL_F77wrap_sger atl_f77wrap_sger_
#define ATL_F77wrap_ssbmv atl_f77wrap_ssbmv_
#define ATL_F77wrap_sspmv atl_f77wrap_sspmv_
#define ATL_F77wrap_ssymv atl_f77wrap_ssymv_
#define ATL_F77wrap_sspr atl_f77wrap_sspr_
#define ATL_F77wrap_ssyr atl_f77wrap_ssyr_
#define ATL_F77wrap_sspr2 atl_f77wrap_sspr2_
#define ATL_F77wrap_ssyr2 atl_f77wrap_ssyr2_
#define ATL_F77wrap_stbmv atl_f77wrap_stbmv_
#define ATL_F77wrap_stpmv atl_f77wrap_stpmv_
#define ATL_F77wrap_strmv atl_f77wrap_strmv_
#define ATL_F77wrap_stbsv atl_f77wrap_stbsv_
#define ATL_F77wrap_stpsv atl_f77wrap_stpsv_
#define ATL_F77wrap_strsv atl_f77wrap_strsv_
#define ATL_F77wrap_sgemm atl_f77wrap_sgemm_
#define ATL_F77wrap_ssymm atl_f77wrap_ssymm_
#define ATL_F77wrap_ssyrk atl_f77wrap_ssyrk_
#define ATL_F77wrap_ssyr2k atl_f77wrap_ssyr2k_
#define ATL_F77wrap_strmm atl_f77wrap_strmm_
#define ATL_F77wrap_strsm atl_f77wrap_strsm_
#elif defined( DREAL )
#define ATL_F77wrap_drotg atl_f77wrap_drotg_
#define ATL_F77wrap_drotmg atl_f77wrap_drotmg_
#define ATL_F77wrap_dnrm2 atl_f77wrap_dnrm2_
#define ATL_F77wrap_dasum atl_f77wrap_dasum_
#define ATL_F77wrap_dscal atl_f77wrap_dscal_
#define ATL_F77wrap_idamax atl_f77wrap_idamax_
#define ATL_F77wrap_daxpy atl_f77wrap_daxpy_
#define ATL_F77wrap_dcopy atl_f77wrap_dcopy_
#define ATL_F77wrap_dswap atl_f77wrap_dswap_
#define ATL_F77wrap_drot atl_f77wrap_drot_
#define ATL_F77wrap_drotm atl_f77wrap_drotm_
#define ATL_F77wrap_ddot atl_f77wrap_ddot_
#define ATL_F77wrap_dgbmv atl_f77wrap_dgbmv_
#define ATL_F77wrap_dgemv atl_f77wrap_dgemv_
#define ATL_F77wrap_dger atl_f77wrap_dger_
#define ATL_F77wrap_dsbmv atl_f77wrap_dsbmv_
#define ATL_F77wrap_dspmv atl_f77wrap_dspmv_
#define ATL_F77wrap_dsymv atl_f77wrap_dsymv_
#define ATL_F77wrap_dspr atl_f77wrap_dspr_
#define ATL_F77wrap_dsyr atl_f77wrap_dsyr_
#define ATL_F77wrap_dspr2 atl_f77wrap_dspr2_
#define ATL_F77wrap_dsyr2 atl_f77wrap_dsyr2_
#define ATL_F77wrap_dtbmv atl_f77wrap_dtbmv_
#define ATL_F77wrap_dtpmv atl_f77wrap_dtpmv_
#define ATL_F77wrap_dtrmv atl_f77wrap_dtrmv_
#define ATL_F77wrap_dtbsv atl_f77wrap_dtbsv_
#define ATL_F77wrap_dtpsv atl_f77wrap_dtpsv_
#define ATL_F77wrap_dtrsv atl_f77wrap_dtrsv_
#define ATL_F77wrap_dgemm atl_f77wrap_dgemm_
#define ATL_F77wrap_dsymm atl_f77wrap_dsymm_
#define ATL_F77wrap_dsyrk atl_f77wrap_dsyrk_
#define ATL_F77wrap_dsyr2k atl_f77wrap_dsyr2k_
#define ATL_F77wrap_dtrmm atl_f77wrap_dtrmm_
#define ATL_F77wrap_dtrsm atl_f77wrap_dtrsm_
#elif defined( SCPLX )
#define ATL_F77wrap_crotg atl_f77wrap_crotg_
#define ATL_F77wrap_scnrm2 atl_f77wrap_scnrm2_
#define ATL_F77wrap_scasum atl_f77wrap_scasum_
#define ATL_F77wrap_cscal atl_f77wrap_cscal_
#define ATL_F77wrap_csscal atl_f77wrap_csscal_
#define ATL_F77wrap_icamax atl_f77wrap_icamax_
#define ATL_F77wrap_caxpy atl_f77wrap_caxpy_
#define ATL_F77wrap_ccopy atl_f77wrap_ccopy_
#define ATL_F77wrap_cswap atl_f77wrap_cswap_
#define ATL_F77wrap_csrot atl_f77wrap_csrot_
#define ATL_F77wrap_cdotc atl_f77wrap_cdotc_
#define ATL_F77wrap_cdotu atl_f77wrap_cdotu_
#define ATL_F77wrap_cgbmv atl_f77wrap_cgbmv_
#define ATL_F77wrap_cgemv atl_f77wrap_cgemv_
#define ATL_F77wrap_cgerc atl_f77wrap_cgerc_
#define ATL_F77wrap_cgeru atl_f77wrap_cgeru_
#define ATL_F77wrap_chbmv atl_f77wrap_chbmv_
#define ATL_F77wrap_chpmv atl_f77wrap_chpmv_
#define ATL_F77wrap_chemv atl_f77wrap_chemv_
#define ATL_F77wrap_chpr atl_f77wrap_chpr_
#define ATL_F77wrap_cher atl_f77wrap_cher_
#define ATL_F77wrap_chpr2 atl_f77wrap_chpr2_
#define ATL_F77wrap_cher2 atl_f77wrap_cher2_
#define ATL_F77wrap_ctbmv atl_f77wrap_ctbmv_
#define ATL_F77wrap_c