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
pzlag2c.c
Go to the documentation of this file.
1 
16 #include "common.h"
17 
18 #define A(m,n) BLKADDR(A, PLASMA_Complex64_t, m, n)
19 #define B(m,n) BLKADDR(B, PLASMA_Complex64_t, m, n)
20 #define SA(m,n) BLKADDR(SA, PLASMA_Complex32_t, m, n)
21 #define SB(m,n) BLKADDR(SB, PLASMA_Complex32_t, m, n)
22 /***************************************************************************/
26 {
27  PLASMA_desc A;
29  PLASMA_sequence *sequence;
30  PLASMA_request *request;
31 
32  int X, Y;
33  int m, n;
34  int next_m;
35  int next_n;
36  int ldam, ldbm;
37  int info = PLASMA_SUCCESS;
38 
39  plasma_unpack_args_4(A, SB, sequence, request);
40  if (sequence->status != PLASMA_SUCCESS)
41  return;
42 
43  n = 0;
44  m = PLASMA_RANK;
45  while (m >= A.mt && n < A.nt) {
46  n++;
47  m = m-A.mt;
48  }
49 
50  while (n < A.nt) {
51  next_m = m;
52  next_n = n;
53 
54  next_m += PLASMA_SIZE;
55  while (next_m >= A.mt && next_n < A.nt) {
56  next_n++;
57  next_m = next_m-A.mt;
58  }
59 
60  X = m == A.mt-1 ? A.m-A.mb*m : A.nb;
61  Y = n == A.nt-1 ? A.n-A.nb*n : A.nb;
62  ldam = BLKLDD(A, m);
63  ldbm = BLKLDD(SB, m);
64  CORE_zlag2c(X, Y, A(m, n), ldam, SB(m, n), ldbm, &info);
65 
66  if (info != 0)
67  plasma_request_fail(sequence, request, info);
68 
69  m = next_m;
70  n = next_n;
71  }
72 }
73 
74 /***************************************************************************/
78  PLASMA_sequence *sequence, PLASMA_request *request)
79 {
82 
83  int X, Y;
84  int m, n;
85  int ldam, ldbm;
86 
87  plasma = plasma_context_self();
88  if (sequence->status != PLASMA_SUCCESS)
89  return;
90  QUARK_Task_Flag_Set(&task_flags, TASK_SEQUENCE, (intptr_t)sequence->quark_sequence);
91 
92  for(m = 0; m < A.mt; m++) {
93  X = m == A.mt-1 ? A.m-m*A.mb : A.mb;
94  ldam = BLKLDD(A, m);
95  ldbm = BLKLDD(SB, m);
96  for(n = 0; n < A.nt; n++) {
97  Y = n == A.nt-1 ? A.n-n*A.nb : A.nb;
99  plasma->quark, &task_flags,
100  X, Y, A.mb,
101  A(m, n), ldam,
102  SB(m, n), ldbm,
103  sequence, request);
104  }
105  }
106 }
107 
108 /***************************************************************************/
112 {
113  PLASMA_desc SA;
114  PLASMA_desc B;
115  PLASMA_sequence *sequence;
116  PLASMA_request *request;
117 
118  int X, Y;
119  int m, n;
120  int ldam, ldbm;
121  int next_m;
122  int next_n;
123 
124  plasma_unpack_args_4(SA, B, sequence, request);
125  if (sequence->status != PLASMA_SUCCESS)
126  return;
127 
128  n = 0;
129  m = PLASMA_RANK;
130  while (m >= SA.mt && n < SA.nt) {
131  n++;
132  m = m-SA.mt;
133  }
134 
135  while (n < SA.nt) {
136  next_m = m;
137  next_n = n;
138 
139  next_m += PLASMA_SIZE;
140  while (next_m >= SA.mt && next_n < SA.nt) {
141  next_n++;
142  next_m = next_m-SA.mt;
143  }
144 
145  X = m == SA.mt-1 ? SA.m-SA.mb*m : SA.nb;
146  Y = n == SA.nt-1 ? SA.n-SA.nb*n : SA.nb;
147  ldam = BLKLDD(SA, m);
148  ldbm = BLKLDD(B, m);
149  CORE_clag2z(X, Y, SA(m, n), ldam, B(m, n), ldbm);
150 
151  m = next_m;
152  n = next_n;
153  }
154 }
155 
156 /***************************************************************************/
160  PLASMA_sequence *sequence, PLASMA_request *request)
161 {
164 
165  int X, Y;
166  int m, n;
167  int ldam, ldbm;
168 
169  plasma = plasma_context_self();
170  if (sequence->status != PLASMA_SUCCESS)
171  return;
172  QUARK_Task_Flag_Set(&task_flags, TASK_SEQUENCE, (intptr_t)sequence->quark_sequence);
173 
174  for(m = 0; m < SA.mt; m++) {
175  X = m == SA.mt-1 ? SA.m-m*SA.mb : SA.mb;
176  ldam = BLKLDD(SA, m);
177  ldbm = BLKLDD(B, m);
178  for(n = 0; n < SA.nt; n++) {
179  Y = n == SA.nt-1 ? SA.n-n*SA.nb : SA.nb;
181  plasma->quark, &task_flags,
182  X, Y, SA.mb,
183  SA(m, n), ldam,
184  B(m, n), ldbm);
185  }
186  }
187 }