PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
pslaswp.c
Go to the documentation of this file.
1 
15 #include "common.h"
16 
17 #define B(m, n) BLKADDR(B, float, m, n)
18 #define IPIV(k) &(IPIV[(int64_t)B.mb*(int64_t)(k)])
19 
20 /***************************************************************************/
23 void plasma_pslaswp_quark(PLASMA_desc B, int *IPIV, int inc,
24  PLASMA_sequence *sequence, PLASMA_request *request)
25 {
28 
29  int m, n;
30  int tempi, tempm, tempmm, tempnn;
31 
32  plasma = plasma_context_self();
33  if (sequence->status != PLASMA_SUCCESS)
34  return;
35  QUARK_Task_Flag_Set(&task_flags, TASK_SEQUENCE, (intptr_t)sequence->quark_sequence);
36 
37  if ( inc > 0 )
38  {
39  for (m = 0; m < B.mt; m++) {
40  tempi = m * B.mb;
41  tempm = B.m - tempi;
42  tempmm = m == B.mt-1 ? tempm : B.mb;
43 
44  for (n = 0; n < B.nt; n++) {
45  tempnn = n == B.nt-1 ? B.n - n * B.nb : B.nb;
46 
48  plasma->quark, &task_flags,
49  plasma_desc_submatrix(B, tempi, n*B.nb, tempm, tempnn),
50  B(m, n), 1, tempmm, IPIV(m), inc, B(B.mt-1, n) );
51  }
52  }
53  }
54  else
55  {
56  for (m = B.mt-1; m > -1; m--) {
57  tempi = m * B.mb;
58  tempm = B.m - tempi;
59  tempmm = m == B.mt-1 ? tempm : B.mb;
60 
61  for (n = 0; n < B.nt; n++) {
62  tempnn = n == B.nt-1 ? B.n - n * B.nb : B.nb;
63 
65  plasma->quark, &task_flags,
66  plasma_desc_submatrix(B, tempi, n*B.nb, tempm, tempnn),
67  B(m, n), 1, tempmm, IPIV(m), inc, B(0, n) );
68  }
69  }
70  }
71 }