Debian Codegraph @

frame/2/trsv/bli_trsv_unb_var1.c

raw symbols SCIP
1 /*
2
3 BLIS
4 An object-based framework for developing high-performance BLAS-like
5 libraries.
6
7 Copyright (C) 2014, The University of Texas at Austin
8
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(s) of the copyright holder(s) nor the names of its
18 contributors may be used to endorse or promote products derived
19 from this software without specific prior written permission.
20
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.
32
33 */
34
35 #include "blis.h"
36
37 #undef GENTFUNC
38 #define GENTFUNC( ctype, ch, varname ) \
39 \
40 void PASTEMAC(ch,varname) \
41 ( \
42 uplo_t uploa, \
43 trans_t transa, \
44 diag_t diaga, \
45 dim_t m, \
46 ctype* alpha, \
47 ctype* a, inc_t rs_a, inc_t cs_a, \
48 ctype* x, inc_t incx, \
49 cntx_t* cntx \
50 ) \
51 { \
52 const num_t dt = PASTEMAC(ch,type); \
53 \
54 ctype* a10t; \
55 ctype* alpha11; \
56 ctype* a12t; \
57 ctype* x0; \
58 ctype* chi1; \
59 ctype* x2; \
60 ctype alpha11_conj; \
61 ctype rho; \
62 dim_t iter, i; \
63 dim_t n_behind; \
64 inc_t rs_at, cs_at; \
65 uplo_t uploa_trans; \
66 conj_t conja; \
67 \
68 if ( bli_does_notrans( transa ) ) \
69 { \
70 rs_at = rs_a; \
71 cs_at = cs_a; \
72 uploa_trans = uploa; \
73 } \
74 else /* if ( bli_does_trans( transa ) ) */ \
75 { \
76 rs_at = cs_a; \
77 cs_at = rs_a; \
78 uploa_trans = bli_uplo_toggled( uploa ); \
79 } \
80 \
81 conja = bli_extract_conj( transa ); \
82 \
83 /* x = alpha * x; */ \
84 PASTEMAC(ch,scalv,BLIS_TAPI_EX_SUF) \
85 ( \
86 BLIS_NO_CONJUGATE, \
87 m, \
88 alpha, \
89 x, incx, \
90 cntx, \
91 NULL \
92 ); \
93 \
94 /* Query the context for the kernel function pointer. */ \
95 dotv_ker_ft kfp_tv = bli_cntx_get_ukr_dt( dt, BLIS_DOTV_KER, cntx ); \
96 \
97 /* We reduce all of the possible cases down to just lower/upper. */ \
98 if ( bli_is_upper( uploa_trans ) ) \
99 { \
100 for ( iter = 0; iter < m; ++iter ) \
101 { \
102 i = m - iter - 1; \
103 n_behind = iter; \
104 alpha11 = a + (i )*rs_at + (i )*cs_at; \
105 a12t = a + (i )*rs_at + (i+1)*cs_at; \
106 chi1 = x + (i )*incx; \
107 x2 = x + (i+1)*incx; \
108 \
109 /* chi1 = chi1 - a12t * x2; */ \
110 kfp_tv \
111 ( \
112 conja, \
113 BLIS_NO_CONJUGATE, \
114 n_behind, \
115 a12t, cs_at, \
116 x2, incx, \
117 &rho, \
118 cntx \
119 ); \
120 bli_tsubs( ch,ch,ch, rho, *chi1 ); \
121 \
122 /* chi1 = chi1 / alpha11; */ \
123 if ( bli_is_nonunit_diag( diaga ) ) \
124 { \
125 bli_tcopycjs( ch,ch, conja, *alpha11, alpha11_conj ); \
126 bli_tinvscals( ch,ch,ch, alpha11_conj, *chi1 ); \
127 } \
128 } \
129 } \
130 else /* if ( bli_is_lower( uploa_trans ) ) */ \
131 { \
132 for ( iter = 0; iter < m; ++iter ) \
133 { \
134 i = iter; \
135 n_behind = i; \
136 alpha11 = a + (i )*rs_at + (i )*cs_at; \
137 a10t = a + (i )*rs_at + (0 )*cs_at; \
138 chi1 = x + (i )*incx; \
139 x0 = x + (0 )*incx; \
140 \
141 /* chi1 = chi1 - a10t * x0; */ \
142 kfp_tv \
143 ( \
144 conja, \
145 BLIS_NO_CONJUGATE, \
146 n_behind, \
147 a10t, cs_at, \
148 x0, incx, \
149 &rho, \
150 cntx \
151 ); \
152 bli_tsubs( ch,ch,ch, rho, *chi1 ); \
153 \
154 /* chi1 = chi1 / alpha11; */ \
155 if ( bli_is_nonunit_diag( diaga ) ) \
156 { \
157 bli_tcopycjs( ch,ch, conja, *alpha11, alpha11_conj ); \
158 bli_tinvscals( ch,ch,ch, alpha11_conj, *chi1 ); \
159 } \
160 } \
161 } \
162 }
163
164 INSERT_GENTFUNC_BASIC( trsv_unb_var1 )
165