libflame  revision_anchor
Functions
FLA_Copyr_external.c File Reference

(r)

Functions

FLA_Error FLA_Copyr_external (FLA_Uplo uplo, FLA_Obj A, FLA_Obj B)
 

Function Documentation

◆ FLA_Copyr_external()

FLA_Error FLA_Copyr_external ( FLA_Uplo  uplo,
FLA_Obj  A,
FLA_Obj  B 
)

References bl1_ccopymr(), bl1_cdcopymr(), bl1_cscopymr(), bl1_czcopymr(), bl1_dccopymr(), bl1_dcopymr(), bl1_dscopymr(), bl1_dzcopymr(), bl1_sccopymr(), bl1_scopymr(), bl1_sdcopymr(), bl1_szcopymr(), bl1_zccopymr(), bl1_zcopymr(), bl1_zdcopymr(), bl1_zscopymr(), FLA_Check_error_level(), FLA_Copyr_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_uplo().

Referenced by FLA_Copyr(), FLA_Copyr_l_task(), FLA_Copyr_task(), FLA_Copyr_u_task(), and FLA_QR_UT_copy_task().

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 
22  if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
23  FLA_Copyr_check( uplo, A, B );
24 
25  if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
26 
27  dt_A = FLA_Obj_datatype( A );
28  dt_B = FLA_Obj_datatype( B );
29 
30  rs_A = FLA_Obj_row_stride( A );
31  cs_A = FLA_Obj_col_stride( A );
32 
33  m_B = FLA_Obj_length( B );
34  n_B = FLA_Obj_width( B );
35  rs_B = FLA_Obj_row_stride( B );
36  cs_B = FLA_Obj_col_stride( B );
37 
38  FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
39 
40  // If A is of type FLA_CONSTANT, then we have to proceed based on the
41  // datatype of B.
42  if ( dt_A == FLA_CONSTANT )
43  {
44  if ( dt_B == FLA_FLOAT )
45  {
46  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
47  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
48 
49  bl1_scopymr( blis_uplo,
50  m_B,
51  n_B,
52  buff_A, rs_A, cs_A,
53  buff_B, rs_B, cs_B );
54  }
55  else if ( dt_B == FLA_DOUBLE )
56  {
57  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
58  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
59 
60  bl1_dcopymr( blis_uplo,
61  m_B,
62  n_B,
63  buff_A, rs_A, cs_A,
64  buff_B, rs_B, cs_B );
65  }
66  else if ( dt_B == FLA_COMPLEX )
67  {
68  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
69  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
70 
71  bl1_ccopymr( blis_uplo,
72  m_B,
73  n_B,
74  buff_A, rs_A, cs_A,
75  buff_B, rs_B, cs_B );
76  }
77  else if ( dt_B == FLA_DOUBLE_COMPLEX )
78  {
79  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
80  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
81 
82  bl1_zcopymr( blis_uplo,
83  m_B,
84  n_B,
85  buff_A, rs_A, cs_A,
86  buff_B, rs_B, cs_B );
87  }
88  }
89 /*
90  else if ( dt_A == FLA_INT )
91  {
92  int* buff_A = ( int * ) FLA_INT_PTR( A );
93  int* buff_B = ( int * ) FLA_INT_PTR( B );
94 
95  bl1_icopymr( blis_uplo,
96  m_B,
97  n_B,
98  buff_A, rs_A, cs_A,
99  buff_B, rs_B, cs_B );
100  }
101 */
102  else if ( dt_A == FLA_FLOAT )
103  {
104  float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
105 
106  if ( dt_B == FLA_FLOAT )
107  {
108  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
109 
110  bl1_scopymr( blis_uplo,
111  m_B,
112  n_B,
113  buff_A, rs_A, cs_A,
114  buff_B, rs_B, cs_B );
115  }
116  else if ( dt_B == FLA_DOUBLE )
117  {
118  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
119 
120  bl1_sdcopymr( blis_uplo,
121  m_B,
122  n_B,
123  buff_A, rs_A, cs_A,
124  buff_B, rs_B, cs_B );
125  }
126  else if ( dt_B == FLA_COMPLEX )
127  {
128  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
129 
130  bl1_sccopymr( blis_uplo,
131  m_B,
132  n_B,
133  buff_A, rs_A, cs_A,
134  buff_B, rs_B, cs_B );
135  }
136  else if ( dt_B == FLA_DOUBLE_COMPLEX )
137  {
138  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
139 
140  bl1_szcopymr( blis_uplo,
141  m_B,
142  n_B,
143  buff_A, rs_A, cs_A,
144  buff_B, rs_B, cs_B );
145  }
146  }
147  else if ( dt_A == FLA_DOUBLE )
148  {
149  double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
150 
151  if ( dt_B == FLA_FLOAT )
152  {
153  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
154 
155  bl1_dscopymr( blis_uplo,
156  m_B,
157  n_B,
158  buff_A, rs_A, cs_A,
159  buff_B, rs_B, cs_B );
160  }
161  else if ( dt_B == FLA_DOUBLE )
162  {
163  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
164 
165  bl1_dcopymr( blis_uplo,
166  m_B,
167  n_B,
168  buff_A, rs_A, cs_A,
169  buff_B, rs_B, cs_B );
170  }
171  else if ( dt_B == FLA_COMPLEX )
172  {
173  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
174 
175  bl1_dccopymr( blis_uplo,
176  m_B,
177  n_B,
178  buff_A, rs_A, cs_A,
179  buff_B, rs_B, cs_B );
180  }
181  else if ( dt_B == FLA_DOUBLE_COMPLEX )
182  {
183  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
184 
185  bl1_dzcopymr( blis_uplo,
186  m_B,
187  n_B,
188  buff_A, rs_A, cs_A,
189  buff_B, rs_B, cs_B );
190  }
191  }
192  else if ( dt_A == FLA_COMPLEX )
193  {
194  scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
195 
196  if ( dt_B == FLA_FLOAT )
197  {
198  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
199 
200  bl1_cscopymr( blis_uplo,
201  m_B,
202  n_B,
203  buff_A, rs_A, cs_A,
204  buff_B, rs_B, cs_B );
205  }
206  else if ( dt_B == FLA_DOUBLE )
207  {
208  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
209 
210  bl1_cdcopymr( blis_uplo,
211  m_B,
212  n_B,
213  buff_A, rs_A, cs_A,
214  buff_B, rs_B, cs_B );
215  }
216  else if ( dt_B == FLA_COMPLEX )
217  {
218  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
219 
220  bl1_ccopymr( blis_uplo,
221  m_B,
222  n_B,
223  buff_A, rs_A, cs_A,
224  buff_B, rs_B, cs_B );
225  }
226  else if ( dt_B == FLA_DOUBLE_COMPLEX )
227  {
228  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
229 
230  bl1_czcopymr( blis_uplo,
231  m_B,
232  n_B,
233  buff_A, rs_A, cs_A,
234  buff_B, rs_B, cs_B );
235  }
236  }
237  else if ( dt_A == FLA_DOUBLE_COMPLEX )
238  {
239  dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
240 
241  if ( dt_B == FLA_FLOAT )
242  {
243  float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
244 
245  bl1_zscopymr( blis_uplo,
246  m_B,
247  n_B,
248  buff_A, rs_A, cs_A,
249  buff_B, rs_B, cs_B );
250  }
251  else if ( dt_B == FLA_DOUBLE )
252  {
253  double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
254 
255  bl1_zdcopymr( blis_uplo,
256  m_B,
257  n_B,
258  buff_A, rs_A, cs_A,
259  buff_B, rs_B, cs_B );
260  }
261  else if ( dt_B == FLA_COMPLEX )
262  {
263  scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
264 
265  bl1_zccopymr( blis_uplo,
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_COMPLEX )
272  {
273  dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
274 
275  bl1_zcopymr( blis_uplo,
276  m_B,
277  n_B,
278  buff_A, rs_A, cs_A,
279  buff_B, rs_B, cs_B );
280  }
281  }
282 
283  return FLA_SUCCESS;
284 }
void bl1_sdcopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:334
void bl1_dccopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:790
uplo1_t
Definition: blis_type_defs.h:60
void bl1_zscopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:658
dim_t FLA_Obj_row_stride(FLA_Obj obj)
Definition: FLA_Query.c:167
void bl1_dzcopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:920
void bl1_zcopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:202
void bl1_zccopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:1180
FLA_Datatype FLA_Obj_datatype(FLA_Obj obj)
Definition: FLA_Query.c:13
void bl1_szcopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:594
void bl1_dcopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:76
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
void bl1_scopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:13
void bl1_sccopymr(uplo1_t uplo, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:464
void FLA_Param_map_flame_to_blis_uplo(FLA_Uplo uplo, uplo1_t *blis_uplo)
Definition: FLA_Param.c:285
Definition: blis_type_defs.h:132
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
void bl1_dscopymr(uplo1_t uplo, int m, int n, double *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:398
int FLA_Datatype
Definition: FLA_type_defs.h:49
void bl1_ccopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:139
dim_t FLA_Obj_col_stride(FLA_Obj obj)
Definition: FLA_Query.c:174
FLA_Error FLA_Copyr_check(FLA_Uplo uplo, FLA_Obj A, FLA_Obj B)
Definition: FLA_Copyr_check.c:13
void bl1_cscopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:528
void bl1_cdcopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:854
void bl1_zdcopymr(uplo1_t uplo, int m, int n, dcomplex *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:984
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
void bl1_czcopymr(uplo1_t uplo, int m, int n, scomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
Definition: bl1_copymr.c:1116
Definition: blis_type_defs.h:137