libflame  revision_anchor
Functions
bl1_ewinvscalmt.c File Reference

(r)

Functions

void bl1_sewinvscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, float *b, int b_rs, int b_cs)
 
void bl1_dewinvscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, double *b, int b_rs, int b_cs)
 
void bl1_csewinvscalmt (trans1_t trans, int m, int n, float *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_cewinvscalmt (trans1_t trans, int m, int n, scomplex *a, int a_rs, int a_cs, scomplex *b, int b_rs, int b_cs)
 
void bl1_zdewinvscalmt (trans1_t trans, int m, int n, double *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 
void bl1_zewinvscalmt (trans1_t trans, int m, int n, dcomplex *a, int a_rs, int a_cs, dcomplex *b, int b_rs, int b_cs)
 

Function Documentation

◆ bl1_cewinvscalmt()

void bl1_cewinvscalmt ( trans1_t  trans,
int  m,
int  n,
scomplex a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)
230 {
231  scomplex* a_begin;
232  scomplex* b_begin;
233  int lda, inca;
234  int ldb, incb;
235  int n_iter;
236  int n_elem;
237  int j;
238  conj1_t conj;
239 
240  // Return early if possible.
241  if ( bl1_zero_dim2( m, n ) ) return;
242 
243  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
244  // gets invoked only once.
245  if ( bl1_is_vector( m, n ) )
246  {
247  // Initialize with values appropriate for vectors.
248  n_iter = 1;
249  n_elem = bl1_vector_dim( m, n );
250  lda = 1; // multiplied by zero when n_iter == 1; not needed.
251  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
252  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
253  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
254  }
255  else // matrix case
256  {
257  // Initialize with optimal values for column-major storage.
258  n_iter = n;
259  n_elem = m;
260  lda = a_cs;
261  inca = a_rs;
262  ldb = b_cs;
263  incb = b_rs;
264 
265  // Handle the transposition of A.
266  if ( bl1_does_trans( trans ) )
267  {
268  bl1_swap_ints( lda, inca );
269  }
270 
271  // An optimization: if B is row-major and if A is effectively row-major
272  // after a possible transposition, then let's access the matrices by rows
273  // instead of by columns for increased spatial locality.
274  if ( bl1_is_row_storage( b_rs, b_cs ) )
275  {
276  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
277  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
278  {
279  bl1_swap_ints( n_iter, n_elem );
280  bl1_swap_ints( lda, inca );
281  bl1_swap_ints( ldb, incb );
282  }
283  }
284  }
285 
286  // Extract conj component from trans parameter.
287  conj = bl1_proj_trans1_to_conj( trans );
288 
289  for ( j = 0; j < n_iter; j++ )
290  {
291  a_begin = a + j*lda;
292  b_begin = b + j*ldb;
293 
294  bl1_cewinvscalv( conj,
295  n_elem,
296  a_begin, inca,
297  b_begin, incb );
298  }
299 }
int bl1_does_notrans(trans1_t trans)
Definition: bl1_does.c:19
int bl1_is_row_storage(int rs, int cs)
Definition: bl1_is.c:95
int bl1_is_vector(int m, int n)
Definition: bl1_is.c:106
int bl1_is_col_storage(int rs, int cs)
Definition: bl1_is.c:90
conj1_t bl1_proj_trans1_to_conj(trans1_t trans)
Definition: bl1_proj.c:13
int bl1_vector_dim(int m, int n)
Definition: bl1_vector.c:13
int bl1_vector_inc(trans1_t trans, int m, int n, int rs, int cs)
Definition: bl1_vector.c:19
int bl1_zero_dim2(int m, int n)
Definition: bl1_is.c:118
int bl1_does_trans(trans1_t trans)
Definition: bl1_does.c:13
void bl1_cewinvscalv(conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy)
Definition: bl1_ewinvscalv.c:58
@ BLIS1_NO_TRANSPOSE
Definition: blis_type_defs.h:54
conj1_t
Definition: blis_type_defs.h:80
Definition: blis_type_defs.h:133

References bl1_cewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

◆ bl1_csewinvscalmt()

void bl1_csewinvscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
scomplex b,
int  b_rs,
int  b_cs 
)
158 {
159  float* a_begin;
160  scomplex* b_begin;
161  int lda, inca;
162  int ldb, incb;
163  int n_iter;
164  int n_elem;
165  int j;
166  conj1_t conj;
167 
168  // Return early if possible.
169  if ( bl1_zero_dim2( m, n ) ) return;
170 
171  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
172  // gets invoked only once.
173  if ( bl1_is_vector( m, n ) )
174  {
175  // Initialize with values appropriate for vectors.
176  n_iter = 1;
177  n_elem = bl1_vector_dim( m, n );
178  lda = 1; // multiplied by zero when n_iter == 1; not needed.
179  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
180  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
181  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
182  }
183  else // matrix case
184  {
185  // Initialize with optimal values for column-major storage.
186  n_iter = n;
187  n_elem = m;
188  lda = a_cs;
189  inca = a_rs;
190  ldb = b_cs;
191  incb = b_rs;
192 
193  // Handle the transposition of A.
194  if ( bl1_does_trans( trans ) )
195  {
196  bl1_swap_ints( lda, inca );
197  }
198 
199  // An optimization: if B is row-major and if A is effectively row-major
200  // after a possible transposition, then let's access the matrices by rows
201  // instead of by columns for increased spatial locality.
202  if ( bl1_is_row_storage( b_rs, b_cs ) )
203  {
204  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
205  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
206  {
207  bl1_swap_ints( n_iter, n_elem );
208  bl1_swap_ints( lda, inca );
209  bl1_swap_ints( ldb, incb );
210  }
211  }
212  }
213 
214  // Extract conj component from trans parameter.
215  conj = bl1_proj_trans1_to_conj( trans );
216 
217  for ( j = 0; j < n_iter; j++ )
218  {
219  a_begin = a + j*lda;
220  b_begin = b + j*ldb;
221 
222  bl1_csewinvscalv( conj,
223  n_elem,
224  a_begin, inca,
225  b_begin, incb );
226  }
227 }
void bl1_csewinvscalv(conj1_t conj, int n, float *x, int incx, scomplex *y, int incy)
Definition: bl1_ewinvscalv.c:43

References bl1_csewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

◆ bl1_dewinvscalmt()

void bl1_dewinvscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
double *  b,
int  b_rs,
int  b_cs 
)
86 {
87  double* a_begin;
88  double* b_begin;
89  int lda, inca;
90  int ldb, incb;
91  int n_iter;
92  int n_elem;
93  int j;
94  conj1_t conj;
95 
96  // Return early if possible.
97  if ( bl1_zero_dim2( m, n ) ) return;
98 
99  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
100  // gets invoked only once.
101  if ( bl1_is_vector( m, n ) )
102  {
103  // Initialize with values appropriate for vectors.
104  n_iter = 1;
105  n_elem = bl1_vector_dim( m, n );
106  lda = 1; // multiplied by zero when n_iter == 1; not needed.
107  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
108  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
109  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
110  }
111  else // matrix case
112  {
113  // Initialize with optimal values for column-major storage.
114  n_iter = n;
115  n_elem = m;
116  lda = a_cs;
117  inca = a_rs;
118  ldb = b_cs;
119  incb = b_rs;
120 
121  // Handle the transposition of A.
122  if ( bl1_does_trans( trans ) )
123  {
124  bl1_swap_ints( lda, inca );
125  }
126 
127  // An optimization: if B is row-major and if A is effectively row-major
128  // after a possible transposition, then let's access the matrices by rows
129  // instead of by columns for increased spatial locality.
130  if ( bl1_is_row_storage( b_rs, b_cs ) )
131  {
132  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
133  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
134  {
135  bl1_swap_ints( n_iter, n_elem );
136  bl1_swap_ints( lda, inca );
137  bl1_swap_ints( ldb, incb );
138  }
139  }
140  }
141 
142  // Extract conj component from trans parameter.
143  conj = bl1_proj_trans1_to_conj( trans );
144 
145  for ( j = 0; j < n_iter; j++ )
146  {
147  a_begin = a + j*lda;
148  b_begin = b + j*ldb;
149 
150  bl1_dewinvscalv( conj,
151  n_elem,
152  a_begin, inca,
153  b_begin, incb );
154  }
155 }
void bl1_dewinvscalv(conj1_t conj, int n, double *x, int incx, double *y, int incy)
Definition: bl1_ewinvscalv.c:28

References bl1_dewinvscalv(), bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

◆ bl1_sewinvscalmt()

void bl1_sewinvscalmt ( trans1_t  trans,
int  m,
int  n,
float *  a,
int  a_rs,
int  a_cs,
float *  b,
int  b_rs,
int  b_cs 
)
14 {
15  float* a_begin;
16  float* b_begin;
17  int lda, inca;
18  int ldb, incb;
19  int n_iter;
20  int n_elem;
21  int j;
22  conj1_t conj;
23 
24  // Return early if possible.
25  if ( bl1_zero_dim2( m, n ) ) return;
26 
27  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
28  // gets invoked only once.
29  if ( bl1_is_vector( m, n ) )
30  {
31  // Initialize with values appropriate for vectors.
32  n_iter = 1;
33  n_elem = bl1_vector_dim( m, n );
34  lda = 1; // multiplied by zero when n_iter == 1; not needed.
35  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
36  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
37  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
38  }
39  else // matrix case
40  {
41  // Initialize with optimal values for column-major storage.
42  n_iter = n;
43  n_elem = m;
44  lda = a_cs;
45  inca = a_rs;
46  ldb = b_cs;
47  incb = b_rs;
48 
49  // Handle the transposition of A.
50  if ( bl1_does_trans( trans ) )
51  {
52  bl1_swap_ints( lda, inca );
53  }
54 
55  // An optimization: if B is row-major and if A is effectively row-major
56  // after a possible transposition, then let's access the matrices by rows
57  // instead of by columns for increased spatial locality.
58  if ( bl1_is_row_storage( b_rs, b_cs ) )
59  {
60  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
61  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
62  {
63  bl1_swap_ints( n_iter, n_elem );
64  bl1_swap_ints( lda, inca );
65  bl1_swap_ints( ldb, incb );
66  }
67  }
68  }
69 
70  // Extract conj component from trans parameter.
71  conj = bl1_proj_trans1_to_conj( trans );
72 
73  for ( j = 0; j < n_iter; j++ )
74  {
75  a_begin = a + j*lda;
76  b_begin = b + j*ldb;
77 
78  bl1_sewinvscalv( conj,
79  n_elem,
80  a_begin, inca,
81  b_begin, incb );
82  }
83 }
void bl1_sewinvscalv(conj1_t conj, int n, float *x, int incx, float *y, int incy)
Definition: bl1_ewinvscalv.c:13

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_sewinvscalv(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().

◆ bl1_zdewinvscalmt()

void bl1_zdewinvscalmt ( trans1_t  trans,
int  m,
int  n,
double *  a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)
302 {
303  double* a_begin;
304  dcomplex* b_begin;
305  int lda, inca;
306  int ldb, incb;
307  int n_iter;
308  int n_elem;
309  int j;
310  conj1_t conj;
311 
312  // Return early if possible.
313  if ( bl1_zero_dim2( m, n ) ) return;
314 
315  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
316  // gets invoked only once.
317  if ( bl1_is_vector( m, n ) )
318  {
319  // Initialize with values appropriate for vectors.
320  n_iter = 1;
321  n_elem = bl1_vector_dim( m, n );
322  lda = 1; // multiplied by zero when n_iter == 1; not needed.
323  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
324  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
325  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
326  }
327  else // matrix case
328  {
329  // Initialize with optimal values for column-major storage.
330  n_iter = n;
331  n_elem = m;
332  lda = a_cs;
333  inca = a_rs;
334  ldb = b_cs;
335  incb = b_rs;
336 
337  // Handle the transposition of A.
338  if ( bl1_does_trans( trans ) )
339  {
340  bl1_swap_ints( lda, inca );
341  }
342 
343  // An optimization: if B is row-major and if A is effectively row-major
344  // after a possible transposition, then let's access the matrices by rows
345  // instead of by columns for increased spatial locality.
346  if ( bl1_is_row_storage( b_rs, b_cs ) )
347  {
348  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
349  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
350  {
351  bl1_swap_ints( n_iter, n_elem );
352  bl1_swap_ints( lda, inca );
353  bl1_swap_ints( ldb, incb );
354  }
355  }
356  }
357 
358  // Extract conj component from trans parameter.
359  conj = bl1_proj_trans1_to_conj( trans );
360 
361  for ( j = 0; j < n_iter; j++ )
362  {
363  a_begin = a + j*lda;
364  b_begin = b + j*ldb;
365 
366  bl1_zdewinvscalv( conj,
367  n_elem,
368  a_begin, inca,
369  b_begin, incb );
370  }
371 }
void bl1_zdewinvscalv(conj1_t conj, int n, double *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewinvscalv.c:88
Definition: blis_type_defs.h:138

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zdewinvscalv(), bl1_zero_dim2(), and BLIS1_NO_TRANSPOSE.

◆ bl1_zewinvscalmt()

void bl1_zewinvscalmt ( trans1_t  trans,
int  m,
int  n,
dcomplex a,
int  a_rs,
int  a_cs,
dcomplex b,
int  b_rs,
int  b_cs 
)
374 {
375  dcomplex* a_begin;
376  dcomplex* b_begin;
377  int lda, inca;
378  int ldb, incb;
379  int n_iter;
380  int n_elem;
381  int j;
382  conj1_t conj;
383 
384  // Return early if possible.
385  if ( bl1_zero_dim2( m, n ) ) return;
386 
387  // Handle cases where A and B are vectors to ensure that the underlying ewinvscal
388  // gets invoked only once.
389  if ( bl1_is_vector( m, n ) )
390  {
391  // Initialize with values appropriate for vectors.
392  n_iter = 1;
393  n_elem = bl1_vector_dim( m, n );
394  lda = 1; // multiplied by zero when n_iter == 1; not needed.
395  inca = bl1_vector_inc( trans, m, n, a_rs, a_cs );
396  ldb = 1; // multiplied by zero when n_iter == 1; not needed.
397  incb = bl1_vector_inc( BLIS1_NO_TRANSPOSE, m, n, b_rs, b_cs );
398  }
399  else // matrix case
400  {
401  // Initialize with optimal values for column-major storage.
402  n_iter = n;
403  n_elem = m;
404  lda = a_cs;
405  inca = a_rs;
406  ldb = b_cs;
407  incb = b_rs;
408 
409  // Handle the transposition of A.
410  if ( bl1_does_trans( trans ) )
411  {
412  bl1_swap_ints( lda, inca );
413  }
414 
415  // An optimization: if B is row-major and if A is effectively row-major
416  // after a possible transposition, then let's access the matrices by rows
417  // instead of by columns for increased spatial locality.
418  if ( bl1_is_row_storage( b_rs, b_cs ) )
419  {
420  if ( ( bl1_is_col_storage( a_rs, a_cs ) && bl1_does_trans( trans ) ) ||
421  ( bl1_is_row_storage( a_rs, a_cs ) && bl1_does_notrans( trans ) ) )
422  {
423  bl1_swap_ints( n_iter, n_elem );
424  bl1_swap_ints( lda, inca );
425  bl1_swap_ints( ldb, incb );
426  }
427  }
428  }
429 
430  // Extract conj component from trans parameter.
431  conj = bl1_proj_trans1_to_conj( trans );
432 
433  for ( j = 0; j < n_iter; j++ )
434  {
435  a_begin = a + j*lda;
436  b_begin = b + j*ldb;
437 
438  bl1_zewinvscalv( conj,
439  n_elem,
440  a_begin, inca,
441  b_begin, incb );
442  }
443 }
void bl1_zewinvscalv(conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy)
Definition: bl1_ewinvscalv.c:103

References bl1_does_notrans(), bl1_does_trans(), bl1_is_col_storage(), bl1_is_row_storage(), bl1_is_vector(), bl1_proj_trans1_to_conj(), bl1_vector_dim(), bl1_vector_inc(), bl1_zero_dim2(), bl1_zewinvscalv(), and BLIS1_NO_TRANSPOSE.

Referenced by FLA_Inv_scal_elemwise().