1 /*
3 BLIS
4 An object-based framework for developing high-performance BLAS-like
5 libraries.
7 Copyright (C) 2014, The University of Texas at Austin
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are
11 met:
12 - Redistributions of source code must retain the above copyright
13 notice, this list of conditions and the following disclaimer.
14 - Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
17 - Neither the name of The University of Texas at Austin nor the names
18 of its contributors may be used to endorse or promote products
19 derived from this software without specific prior written permission.
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
35 #include "blis.h"
38 //
39 // Define BLAS-to-BLIS interfaces.
40 //
41 #undef GENTFUNCRO
42 #define GENTFUNCRO( ftype, ch, blasname, blisname ) \
43 \
44 void PASTEF77(ch,blasname)( \
45 f77_char* uploa, \
46 f77_int* m, \
47 ftype* alpha, \
48 ftype* x, f77_int* incx, \
49 ftype* y, f77_int* incy, \
50 ftype* a, f77_int* lda \
51 ) \
52 { \
53 uplo_t blis_uploa; \
54 dim_t m0; \
55 ftype* x0; \
56 ftype* y0; \
57 inc_t incx0; \
58 inc_t incy0; \
59 inc_t rs_a, cs_a; \
60 err_t init_result; \
61 \
62 /* Initialize BLIS (if it is not already initialized). */ \
63 bli_init_auto( &init_result ); \
64 \
65 /* Perform BLAS parameter checking. */ \
66 PASTEBLACHK(blasname)( MKSTR(ch), \
67 MKSTR(blasname), \
68 uploa, \
69 m, \
70 incx, \
71 incy, \
72 lda ); \
73 \
74 /* Map BLAS chars to their corresponding BLIS enumerated type value. */ \
75 bli_param_map_netlib_to_blis_uplo( *uploa, &blis_uploa ); \
76 \
77 /* Convert/typecast negative values of m to zero. */ \
78 bli_convert_blas_dim1( *m, m0 ); \
79 \
80 /* If the input increments are negative, adjust the pointers so we can
81 use positive increments instead. */ \
82 bli_convert_blas_incv( m0, x, *incx, x0, incx0 ); \
83 bli_convert_blas_incv( m0, y, *incy, y0, incy0 ); \
84 \
85 /* Set the row and column strides of A. */ \
86 rs_a = 1; \
87 cs_a = *lda; \
88 \
89 /* Call BLIS interface. */ \
90 PASTEMAC(ch,blisname)( blis_uploa, \
91 BLIS_NO_CONJUGATE, \
92 BLIS_NO_CONJUGATE, \
93 m0, \
94 alpha, \
95 x0, incx0, \
96 y0, incy0, \
97 a, rs_a, cs_a ); \
98 \
99 /* Finalize BLIS (if it was initialized above). */ \
100 bli_finalize_auto( init_result ); \
101 }
103 #ifdef BLIS_ENABLE_BLAS2BLIS
104 INSERT_GENTFUNCRO_BLAS( syr2, syr2 )
105 #endif