d01232f65bd0013ff044285822ae44ece6932411
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"
37 //
38 // Define object-based interface.
39 //
40 void bli_symm( side_t side,
41 obj_t* alpha,
42 obj_t* a,
43 obj_t* b,
44 obj_t* beta,
45 obj_t* c )
46 {
47 num_t dt = bli_obj_datatype( *c );
49 if ( bli_3mh_is_enabled_dt( dt ) ) bli_symm3mh_entry( side, alpha, a, b, beta, c );
50 else if ( bli_3m_is_enabled_dt( dt ) ) bli_symm3m_entry( side, alpha, a, b, beta, c );
51 else if ( bli_4mh_is_enabled_dt( dt ) ) bli_symm4mh_entry( side, alpha, a, b, beta, c );
52 else if ( bli_4m_is_enabled_dt( dt ) ) bli_symm4m_entry( side, alpha, a, b, beta, c );
53 else bli_symm_entry( side, alpha, a, b, beta, c );
54 }
57 //
58 // Define BLAS-like interfaces with homogeneous-typed operands.
59 //
60 #undef GENTFUNC
61 #define GENTFUNC( ctype, ch, opname, varname ) \
62 \
63 void PASTEMAC(ch,opname)( \
64 side_t side, \
65 uplo_t uploa, \
66 conj_t conja, \
67 trans_t transb, \
68 dim_t m, \
69 dim_t n, \
70 ctype* alpha, \
71 ctype* a, inc_t rs_a, inc_t cs_a, \
72 ctype* b, inc_t rs_b, inc_t cs_b, \
73 ctype* beta, \
74 ctype* c, inc_t rs_c, inc_t cs_c \
75 ) \
76 { \
77 const num_t dt = PASTEMAC(ch,type); \
78 \
79 obj_t alphao, ao, bo, betao, co; \
80 \
81 dim_t mn_a; \
82 dim_t m_b, n_b; \
83 \
84 bli_set_dim_with_side( side, m, n, mn_a ); \
85 bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \
86 \
87 bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \
88 bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \
89 \
90 bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \
91 bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \
92 bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \
93 \
94 bli_obj_set_uplo( uploa, ao ); \
95 bli_obj_set_conj( conja, ao ); \
96 bli_obj_set_conjtrans( transb, bo ); \
97 \
98 bli_obj_set_struc( BLIS_SYMMETRIC, ao ); \
99 \
100 PASTEMAC0(opname)( side, \
101 &alphao, \
102 &ao, \
103 &bo, \
104 &betao, \
105 &co ); \
106 }
108 INSERT_GENTFUNC_BASIC( symm, symm )
111 //
112 // Define BLAS-like interfaces with heterogeneous-typed operands.
113 //
114 #undef GENTFUNC3U12
115 #define GENTFUNC3U12( ctype_a, ctype_b, ctype_c, ctype_ab, cha, chb, chc, chab, opname, varname ) \
116 \
117 void PASTEMAC3(cha,chb,chc,opname)( \
118 side_t side, \
119 uplo_t uploa, \
120 conj_t conja, \
121 trans_t transb, \
122 dim_t m, \
123 dim_t n, \
124 ctype_ab* alpha, \
125 ctype_a* a, inc_t rs_a, inc_t cs_a, \
126 ctype_b* b, inc_t rs_b, inc_t cs_b, \
127 ctype_c* beta, \
128 ctype_c* c, inc_t rs_c, inc_t cs_c \
129 ) \
130 { \
131 bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \
132 }
134 INSERT_GENTFUNC3U12_BASIC( symm, symm )
136 #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
137 INSERT_GENTFUNC3U12_MIX_D( symm, symm )
138 #endif
140 #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
141 INSERT_GENTFUNC3U12_MIX_P( symm, symm )
142 #endif