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_trsm( side_t side,
41 obj_t* alpha,
42 obj_t* a,
43 obj_t* b )
44 {
45 num_t dt = bli_obj_datatype( *b );
47 if ( bli_3m_is_enabled_dt( dt ) ) bli_trsm3m_entry( side, alpha, a, b );
48 else if ( bli_4m_is_enabled_dt( dt ) ) bli_trsm4m_entry( side, alpha, a, b );
49 else bli_trsm_entry( side, alpha, a, b );
50 }
53 //
54 // Define BLAS-like interfaces with homogeneous-typed operands.
55 //
56 #undef GENTFUNC
57 #define GENTFUNC( ctype, ch, opname, varname ) \
58 \
59 void PASTEMAC(ch,opname)( \
60 side_t side, \
61 uplo_t uploa, \
62 trans_t transa, \
63 diag_t diaga, \
64 dim_t m, \
65 dim_t n, \
66 ctype* alpha, \
67 ctype* a, inc_t rs_a, inc_t cs_a, \
68 ctype* b, inc_t rs_b, inc_t cs_b \
69 ) \
70 { \
71 const num_t dt = PASTEMAC(ch,type); \
72 \
73 obj_t alphao, ao, bo; \
74 \
75 dim_t mn_a; \
76 \
77 bli_set_dim_with_side( side, m, n, mn_a ); \
78 \
79 bli_obj_create_1x1_with_attached_buffer( dt, alpha, &alphao ); \
80 \
81 bli_obj_create_with_attached_buffer( dt, mn_a, mn_a, a, rs_a, cs_a, &ao ); \
82 bli_obj_create_with_attached_buffer( dt, m, n, b, rs_b, cs_b, &bo ); \
83 \
84 bli_obj_set_uplo( uploa, ao ); \
85 bli_obj_set_diag( diaga, ao ); \
86 bli_obj_set_conjtrans( transa, ao ); \
87 \
88 bli_obj_set_struc( BLIS_TRIANGULAR, ao ); \
89 \
90 PASTEMAC0(opname)( side, \
91 &alphao, \
92 &ao, \
93 &bo ); \
94 }
96 INSERT_GENTFUNC_BASIC( trsm, trsm )
99 //
100 // Define BLAS-like interfaces with heterogeneous-typed operands.
101 //
102 #undef GENTFUNC2
103 #define GENTFUNC2( ctype_a, ctype_b, cha, chb, opname, varname ) \
104 \
105 void PASTEMAC2(cha,chb,opname)( \
106 side_t side, \
107 uplo_t uploa, \
108 trans_t transa, \
109 diag_t diaga, \
110 dim_t m, \
111 dim_t n, \
112 ctype_a* alpha, \
113 ctype_a* a, inc_t rs_a, inc_t cs_a, \
114 ctype_b* b, inc_t rs_b, inc_t cs_b \
115 ) \
116 { \
117 bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \
118 }
120 INSERT_GENTFUNC2_BASIC( trsm, trsm )
122 #ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
123 INSERT_GENTFUNC2_MIX_D( trsm, trsm )
124 #endif
126 #ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
127 INSERT_GENTFUNC2_MIX_P( trsm, trsm )
128 #endif