libflame  revision_anchor
Functions
FLA_Copyrt_external.c File Reference

(r)

Functions

FLA_Error FLA_Copyrt_external (FLA_Uplo uplo, FLA_Trans trans, FLA_Obj A, FLA_Obj B)
 

Function Documentation

◆ FLA_Copyrt_external()

FLA_Error FLA_Copyrt_external ( FLA_Uplo  uplo,
FLA_Trans  trans,
FLA_Obj  A,
FLA_Obj  B 
)
14 {
15  FLA_Datatype dt_A;
16  FLA_Datatype dt_B;
17  int m_B, n_B;
18  int rs_A, cs_A;
19  int rs_B, cs_B;
20  uplo1_t blis_uplo;
21  trans1_t blis_trans;
22 
23  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
24  FLA_Copyrt_check( uplo, trans, A, B );
25 
26  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
27 
28  dt_A = FLA_Obj_datatype( A );
29  dt_B = FLA_Obj_datatype( B );
30 
31  rs_A = FLA_Obj_row_stride( A );
32  cs_A = FLA_Obj_col_stride( A );
33 
34  m_B = FLA_Obj_length( B );
35  n_B = FLA_Obj_width( B );
36  rs_B = FLA_Obj_row_stride( B );
37  cs_B = FLA_Obj_col_stride( B );
38 
39  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
40  FLA_Param_map_flame_to_blis_trans( trans, &blis_trans );
41 
42  // If A is of type FLA_CONSTANT, then we have to proceed based on the
43  // datatype of B.
44  if ( dt_A == FLA_CONSTANT )
45  {
46  if ( dt_B == FLA_FLOAT )
47  {
48  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
49  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
50 
51  bl1_scopymrt( blis_uplo,
52  blis_trans,
53  m_B,
54  n_B,
55  buff_A, rs_A, cs_A,
56  buff_B, rs_B, cs_B );
57  }
58  else if ( dt_B == FLA_DOUBLE )
59  {
60  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
61  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
62 
63  bl1_dcopymrt( blis_uplo,
64  blis_trans,
65  m_B,
66  n_B,
67  buff_A, rs_A, cs_A,
68  buff_B, rs_B, cs_B );
69  }
70  else if ( dt_B == FLA_COMPLEX )
71  {
72  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
73  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
74 
75  bl1_ccopymrt( blis_uplo,
76  blis_trans,
77  m_B,
78  n_B,
79  buff_A, rs_A, cs_A,
80  buff_B, rs_B, cs_B );
81  }
82  else if ( dt_B == FLA_DOUBLE_COMPLEX )
83  {
84  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
85  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
86 
87  bl1_zcopymrt( blis_uplo,
88  blis_trans,
89  m_B,
90  n_B,
91  buff_A, rs_A, cs_A,
92  buff_B, rs_B, cs_B );
93  }
94  }
95 /*
96  else if ( dt_A == FLA_INT )
97  {
98  int* buff_A = ( int * ) FLA_INT_PTR( A );
99  int* buff_B = ( int * ) FLA_INT_PTR( B );
100 
101  bl1_icopymrt( blis_uplo,
102  blis_trans,
103  m_B,
104  n_B,
105  buff_A, rs_A, cs_A,
106  buff_B, rs_B, cs_B );
107  }
108 */
109  else if ( dt_A == FLA_FLOAT )
110  {
111  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
112 
113  if ( dt_B == FLA_FLOAT )
114  {
115  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
116 
117  bl1_scopymrt( blis_uplo,
118  blis_trans,
119  m_B,
120  n_B,
121  buff_A, rs_A, cs_A,
122  buff_B, rs_B, cs_B );
123  }
124  else if ( dt_B == FLA_DOUBLE )
125  {
126  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
127 
128  bl1_sdcopymrt( blis_uplo,
129  blis_trans,
130  m_B,
131  n_B,
132  buff_A, rs_A, cs_A,
133  buff_B, rs_B, cs_B );
134  }
135  else if ( dt_B == FLA_COMPLEX )
136  {
137  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
138 
139  bl1_sccopymrt( blis_uplo,
140  blis_trans,
141  m_B,
142  n_B,
143  buff_A, rs_A, cs_A,
144  buff_B, rs_B, cs_B );
145  }
146  else if ( dt_B == FLA_DOUBLE_COMPLEX )
147  {
148  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
149 
150  bl1_szcopymrt( blis_uplo,
151  blis_trans,
152  m_B,
153  n_B,
154  buff_A, rs_A, cs_A,
155  buff_B, rs_B, cs_B );
156  }
157  }
158  else if ( dt_A == FLA_DOUBLE )
159  {
160  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
161 
162  if ( dt_B == FLA_FLOAT )
163  {
164  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
165 
166  bl1_dscopymrt( blis_uplo,
167  blis_trans,
168  m_B,
169  n_B,
170  buff_A, rs_A, cs_A,
171  buff_B, rs_B, cs_B );
172  }
173  else if ( dt_B == FLA_DOUBLE )
174  {
175  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
176 
177  bl1_dcopymrt( blis_uplo,
178  blis_trans,
179  m_B,
180  n_B,
181  buff_A, rs_A, cs_A,
182  buff_B, rs_B, cs_B );
183  }
184  else if ( dt_B == FLA_COMPLEX )
185  {
186  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
187 
188  bl1_dccopymrt( blis_uplo,
189  blis_trans,
190  m_B,
191  n_B,
192  buff_A, rs_A, cs_A,
193  buff_B, rs_B, cs_B );
194  }
195  else if ( dt_B == FLA_DOUBLE_COMPLEX )
196  {
197  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
198 
199  bl1_dzcopymrt( blis_uplo,
200  blis_trans,
201  m_B,
202  n_B,
203  buff_A, rs_A, cs_A,
204  buff_B, rs_B, cs_B );
205  }
206  }
207  else if ( dt_A == FLA_COMPLEX )
208  {
209  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
210 
211  if ( dt_B == FLA_FLOAT )
212  {
213  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
214 
215  bl1_cscopymrt( blis_uplo,
216  blis_trans,
217  m_B,
218  n_B,
219  buff_A, rs_A, cs_A,
220  buff_B, rs_B, cs_B );
221  }
222  else if ( dt_B == FLA_DOUBLE )
223  {
224  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
225 
226  bl1_cdcopymrt( blis_uplo,
227  blis_trans,
228  m_B,
229  n_B,
230  buff_A, rs_A, cs_A,
231  buff_B, rs_B, cs_B );
232  }
233  else if ( dt_B == FLA_COMPLEX )
234  {
235  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
236 
237  bl1_ccopymrt( blis_uplo,
238  blis_trans,
239  m_B,
240  n_B,
241  buff_A, rs_A, cs_A,
242  buff_B, rs_B, cs_B );
243  }
244  else if ( dt_B == FLA_DOUBLE_COMPLEX )
245  {
246  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
247 
248  bl1_czcopymrt( blis_uplo,
249  blis_trans,
250  m_B,
251  n_B,
252  buff_A, rs_A, cs_A,
253  buff_B, rs_B, cs_B );
254  }
255  }
256  else if ( dt_A == FLA_DOUBLE_COMPLEX )
257  {
258  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
259 
260  if ( dt_B == FLA_FLOAT )
261  {
262  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
263 
264  bl1_zscopymrt( blis_uplo,
265  blis_trans,
266  m_B,
267  n_B,
268  buff_A, rs_A, cs_A,
269  buff_B, rs_B, cs_B );
270  }
271  else if ( dt_B == FLA_DOUBLE )
272  {
273  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
274 
275  bl1_zdcopymrt( blis_uplo,
276  blis_trans,
277  m_B,
278  n_B,
279  buff_A, rs_A, cs_A,
280  buff_B, rs_B, cs_B );
281  }
282  else if ( dt_B == FLA_COMPLEX )
283  {
284  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
285 
286  bl1_zccopymrt( blis_uplo,
287  blis_trans,
288  m_B,
289  n_B,
290  buff_A, rs_A, cs_A,
291  buff_B, rs_B, cs_B );
292  }
293  else if ( dt_B == FLA_DOUBLE_COMPLEX )
294  {
295  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
296 
297  bl1_zcopymrt( blis_uplo,
298  blis_trans,
299  m_B,
300  n_B,
301  buff_A, rs_A, cs_A,
302  buff_B, rs_B, cs_B );
303  }
304  }
305 
306  return FLA_SUCCESS;
307 }
FLA_Error FLA_Copyrt_check(FLA_Uplo uplo, FLA_Trans trans, FLA_Obj A, FLA_Obj B)
Definition: FLA_Copyrt_check.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void FLA_Param_map_flame_to_blis_trans(FLA_Trans trans, trans1_t *blis_trans)
Definition: FLA_Param.c:245
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_ccopymrt(uplo1_t uplo, trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:223
void bl1_zcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:328
void bl1_cscopymrt(uplo1_t uplo, trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1284
void bl1_scopymrt(uplo1_t uplo, trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:13
void bl1_zccopymrt(uplo1_t uplo, trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1920
void bl1_szcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:754
void bl1_zscopymrt(uplo1_t uplo, trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1708
void bl1_zdcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1814
void bl1_czcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1602
void bl1_sccopymrt(uplo1_t uplo, trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:648
void bl1_dscopymrt(uplo1_t uplo, trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:860
void bl1_cdcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1390
void bl1_dcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:118
void bl1_sdcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:542
void bl1_dzcopymrt(uplo1_t uplo, trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1178
void bl1_dccopymrt(uplo1_t uplo, trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymrt.c:1072
uplo1_t
Definition: blis_type_defs.h:61
trans1_t
Definition: blis_type_defs.h:53
Definition: blis_type_defs.h:138
Definition: blis_type_defs.h:133

References bl1_ccopymrt(), bl1_cdcopymrt(), bl1_cscopymrt(), bl1_czcopymrt(), bl1_dccopymrt(), bl1_dcopymrt(), bl1_dscopymrt(), bl1_dzcopymrt(), bl1_sccopymrt(), bl1_scopymrt(), bl1_sdcopymrt(), bl1_szcopymrt(), bl1_zccopymrt(), bl1_zcopymrt(), bl1_zdcopymrt(), bl1_zscopymrt(), FLA_Check_error_level(), FLA_Copyrt_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_trans(), and FLA_Param_map_flame_to_blis_uplo().

Referenced by FLA_Copyrt().