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_symm3m( 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 // Since 3m only applies to the complex domain, we use the regular
48 // implementation for real domain cases.
49 if ( bli_obj_is_complex( *c ) )
50 bli_symm3m_entry( side, alpha, a, b, beta, c );
51 else
52 bli_symm_entry( side, alpha, a, b, beta, c );
53 }
55 //
56 // Define BLAS-like interfaces with homogeneous-typed operands.
57 //
58 #undef GENTFUNC
59 #define GENTFUNC( ctype, ch, opname, varname ) \
60 \
61 void PASTEMAC(ch,opname)( \
62 side_t side, \
63 uplo_t uploa, \
64 conj_t conja, \
65 trans_t transb, \
66 dim_t m, \
67 dim_t n, \
68 ctype* alpha, \
69 ctype* a, inc_t rs_a, inc_t cs_a, \
70 ctype* b, inc_t rs_b, inc_t cs_b, \
71 ctype* beta, \
72 ctype* c, inc_t rs_c, inc_t cs_c \
73 ) \
74 { \
75 const num_t dt = PASTEMAC(ch,type); \
76 \
77 obj_t alphao, ao, bo, betao, co; \
78 \
79 dim_t mn_a; \
80 dim_t m_b, n_b; \
81 \
82 bli_set_dim_with_side( side, m, n, mn_a ); \
83 bli_set_dims_with_trans( transb, m, n, m_b, n_b ); \
84 \
85 bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \
86 bli_obj_create_1x1_with_attached_buffer( dt, beta, &betao ); \
87 \
88 bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \
89 bli_obj_create_with_attached_buffer( dt, m_b, n_b, b, rs_b, cs_b, &bo ); \
90 bli_obj_create_with_attached_buffer( dt, m, n, c, rs_c, cs_c, &co ); \
91 \
92 bli_obj_set_uplo( uploa, ao ); \
93 bli_obj_set_conj( conja, ao ); \
94 bli_obj_set_conjtrans( transb, bo ); \
95 \
96 bli_obj_set_struc( BLIS_SYMMETRIC, ao ); \
97 \
98 PASTEMAC0(opname)( side, \
99 &alphao, \
100 &ao, \
101 &bo, \
102 &betao, \
103 &co ); \
104 }
106 INSERT_GENTFUNC_BASIC( symm3m, symm3m )