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 object-based interface.
40 //
41 #undef GENFRONT
42 #define GENFRONT( opname, varname ) \
43 \
44 void PASTEMAC0(opname)( \
45 obj_t* alpha, \
46 obj_t* a, \
47 obj_t* x, \
48 obj_t* beta, \
49 obj_t* y \
50 ) \
51 { \
52 obj_t a_local; \
53 \
54 if ( bli_error_checking_is_enabled() ) \
55 PASTEMAC(opname,_check)( alpha, a, x, beta, y ); \
56 \
57 bli_obj_alias_to( *a, a_local ); \
58 \
59 if ( bli_obj_has_trans( a_local ) ) \
60 { \
61 bli_obj_induce_trans( a_local ); \
62 bli_obj_toggle_trans( a_local ); \
63 } \
64 \
65 PASTEMAC0(varname)( alpha, \
66 &a_local, \
67 x, \
68 beta, \
69 y ); \
70 }
72 GENFRONT( dotxf, dotxf_kernel )
75 //
76 // Define BLAS-like interfaces with homogeneous-typed operands.
77 //
78 #undef GENTFUNC
79 #define GENTFUNC( ctype, ch, opname, varname ) \
80 \
81 void PASTEMAC(ch,opname)( \
82 conj_t conjat, \
83 conj_t conjx, \
84 dim_t m, \
85 dim_t b_n, \
86 ctype* alpha, \
87 ctype* a, inc_t inca, inc_t lda, \
88 ctype* x, inc_t incx, \
89 ctype* beta, \
90 ctype* y, inc_t incy \
91 ) \
92 { \
93 PASTEMAC3(ch,ch,ch,varname)( conjat, \
94 conjx, \
95 m, \
96 b_n, \
97 alpha, \
98 a, inca, lda, \
99 x, incx, \
100 beta, \
101 y, incy ); \
102 }
104 INSERT_GENTFUNC_BASIC( dotxf, DOTXF_KERNEL )
107 //
108 // Define BLAS-like interfaces with heterogeneous-typed operands.
109 //
110 #undef GENTFUNC3U12
111 #define GENTFUNC3U12( ctype_a, ctype_x, ctype_y, ctype_ax, cha, chx, chy, chax, opname, varname ) \
112 \
113 void PASTEMAC3(cha,chx,chy,opname)( \
114 conj_t conjat, \
115 conj_t conjx, \
116 dim_t m, \
117 dim_t b_n, \
118 ctype_ax* alpha, \
119 ctype_a* a, inc_t inca, inc_t lda, \
120 ctype_x* x, inc_t incx, \
121 ctype_y* beta, \
122 ctype_y* y, inc_t incy \
123 ) \
124 { \
125 PASTEMAC3(cha,chx,chy,varname)( conjat, \
126 conjx, \
127 m, \
128 b_n, \
129 alpha, \
130 a, inca, lda, \
131 x, incx, \
132 beta, \
133 y, incy ); \
134 }
136 // Define the basic set of functions unconditionally, and then also some
137 // mixed datatype functions if requested.
138 INSERT_GENTFUNC3U12_BASIC( dotxf, DOTXF_KERNEL )
140 #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
141 INSERT_GENTFUNC3U12_MIX_D( dotxf, DOTXF_KERNEL )
142 #endif
144 #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
145 INSERT_GENTFUNC3U12_MIX_P( dotxf, DOTXF_KERNEL )
146 #endif