]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - dense-linear-algebra-libraries/linalg.git/blob - blis/frame/compat/bla_ger.c
TI Linear Algebra Library (LINALG) Rlease 1.0.0
[dense-linear-algebra-libraries/linalg.git] / blis / frame / compat / bla_ger.c
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  GENTFUNCDOT
42 #define GENTFUNCDOT( ftype, chxy, chc, blis_conjy, blasname, blisname ) \
43 \
44 void PASTEF772(chxy,blasname,chc)( \
45                                    f77_int* m, \
46                                    f77_int* n, \
47                                    ftype*   alpha, \
48                                    ftype*   x, f77_int* incx, \
49                                    ftype*   y, f77_int* incy, \
50                                    ftype*   a, f77_int* lda   \
51                                  ) \
52 { \
53         dim_t   m0, n0; \
54         ftype*  x0; \
55         ftype*  y0; \
56         inc_t   incx0; \
57         inc_t   incy0; \
58         inc_t   rs_a, cs_a; \
59         err_t   init_result; \
60 \
61         /* Initialize BLIS (if it is not already initialized). */ \
62         bli_init_auto( &init_result ); \
63 \
64         /* Perform BLAS parameter checking. */ \
65         PASTEBLACHK(blasname)( MKSTR(ch), \
66                                MKSTR(blasname), \
67                                m, \
68                                n, \
69                                incx, \
70                                incy, \
71                                lda ); \
72 \
73         /* Convert/typecast negative values of m and n to zero. */ \
74         bli_convert_blas_dim1( *m, m0 ); \
75         bli_convert_blas_dim1( *n, n0 ); \
76 \
77         /* If the input increments are negative, adjust the pointers so we can
78            use positive increments instead. */ \
79         bli_convert_blas_incv( m0, x, *incx, x0, incx0 ); \
80         bli_convert_blas_incv( n0, y, *incy, y0, incy0 ); \
81 \
82         /* Set the row and column strides of A. */ \
83         rs_a = 1; \
84         cs_a = *lda; \
85 \
86         /* Call BLIS interface. */ \
87         PASTEMAC(chxy,blisname)( BLIS_NO_CONJUGATE, \
88                                  blis_conjy, \
89                                  m0, \
90                                  n0, \
91                                  alpha, \
92                                  x0, incx0, \
93                                  y0, incy0, \
94                                  a,  rs_a, cs_a ); \
95 \
96         /* Finalize BLIS (if it was initialized above). */ \
97         bli_finalize_auto( init_result ); \
98 }
100 #ifdef BLIS_ENABLE_BLAS2BLIS
101 INSERT_GENTFUNCDOT_BLAS( ger, ger )
102 #endif