21 #define PLASMA_zlag2c(_descA, _descSB) \
22 plasma_parallel_call_4(plasma_pzlag2c, \
23 PLASMA_desc, (_descA), \
24 PLASMA_desc, (_descSB), \
25 PLASMA_sequence*, sequence, \
26 PLASMA_request*, request)
28 #define PLASMA_clag2z(_descSA, _descB) \
29 plasma_parallel_call_4(plasma_pclag2z, \
30 PLASMA_desc, (_descSA), \
31 PLASMA_desc, (_descB), \
32 PLASMA_sequence*, sequence, \
33 PLASMA_request*, request)
35 #define PLASMA_zlange(_norm, _descA, _result, _work) \
37 plasma_parallel_call_6(plasma_pzlange, \
38 PLASMA_enum, (_norm), \
39 PLASMA_desc, (_descA), \
41 double*, &(_result), \
42 PLASMA_sequence*, sequence, \
43 PLASMA_request*, request);
45 #define PLASMA_zlacpy(_descA, _descB) \
46 plasma_parallel_call_5(plasma_pzlacpy, \
47 PLASMA_enum, PlasmaUpperLower, \
48 PLASMA_desc, (_descA), \
49 PLASMA_desc, (_descB), \
50 PLASMA_sequence*, sequence, \
51 PLASMA_request*, request)
53 #define PLASMA_zgeadd(_alpha, _descA, _descB) \
54 plasma_parallel_call_5(plasma_pzgeadd, \
55 PLASMA_Complex64_t, (_alpha), \
56 PLASMA_desc, (_descA), \
57 PLASMA_desc, (_descB), \
58 PLASMA_sequence*, sequence, \
59 PLASMA_request*, request)
179 if (plasma == NULL) {
185 plasma_error(
"PLASMA_zcungesv",
"only PlasmaNoTrans supported");
193 plasma_error(
"PLASMA_zcungesv",
"illegal value of NRHS");
196 if (LDA <
max(1, N)) {
197 plasma_error(
"PLASMA_zcungesv",
"illegal value of LDA");
200 if (LDB <
max(1, N)) {
201 plasma_error(
"PLASMA_zcungesv",
"illegal value of LDB");
204 if (LDX <
max(1, N)) {
205 plasma_error(
"PLASMA_zcungesv",
"illegal value of LDX");
216 plasma_error(
"PLASMA_zcungesv",
"plasma_tune() failed");
226 plasma_zooplap2tile( descA, A, NB, NB, LDA, N, 0, 0, N, N ,
plasma_desc_mat_free(&(descA)) );
227 plasma_zooplap2tile( descB, B, NB, NB, LDB, NRHS, 0, 0, N, NRHS,
plasma_desc_mat_free(&(descA));
plasma_desc_mat_free(&(descB)) );
235 LDX, NRHS, 0, 0, N, NRHS);
337 if (plasma == NULL) {
346 status = sequence->
status;
391 const int itermax = 30;
392 const double bwdmax = 1.0;
396 double Anorm, cte, eps, Rnorm, Xnorm;
400 if (plasma == NULL) {
404 if (sequence == NULL) {
408 if (request == NULL) {
419 plasma_error(
"PLASMA_zcungesv_Tile",
"invalid first descriptor");
423 plasma_error(
"PLASMA_zcungesv_Tile",
"invalid second descriptor");
427 plasma_error(
"PLASMA_zcungesv_Tile",
"invalid third descriptor");
431 plasma_error(
"PLASMA_zcungesv_Tile",
"invalid fourth descriptor");
435 if ( (descA.
nb != descA.
mb) || (descB.
nb != descB.
mb) || (descX.
nb != descX.
mb) ||
436 (descA.
mb != descB.
mb) || (descB.
mb != descX.
mb) ) {
437 plasma_error(
"PLASMA_zcungesv_Tile",
"only square tiles of same size are supported");
441 plasma_error(
"PLASMA_zcungesv_Tile",
"only PlasmaNoTrans supported");
452 plasma_error(
"PLASMA_zcungesv",
"plasma_shared_alloc() failed");
457 plasma_zdesc_alloc( descR, NB, NB, descB.
m, descB.
n, 0, 0, descB.
m, descB.
n,
plasma_shared_free( plasma, work );
plasma_desc_mat_free(&descR) );
458 plasma_cdesc_alloc( descSA, NB, NB, descA.
m, descA.
n, 0, 0, descA.
m, descA.
n,
plasma_shared_free( plasma, work );
plasma_desc_mat_free(&descR);
plasma_desc_mat_free(&descSA) );
459 plasma_cdesc_alloc( descST, IB, NB, descT.
m, descT.
n, 0, 0, descT.
m, descT.
n,
plasma_shared_free( plasma, work );
plasma_desc_mat_free(&descR);
plasma_desc_mat_free(&descSA);
plasma_desc_mat_free(&descST) );
460 plasma_cdesc_alloc( descSX, NB, NB, descX.
m, descX.
n, 0, 0, descX.
m, descX.
n,
plasma_shared_free( plasma, work );
plasma_desc_mat_free(&descR);
plasma_desc_mat_free(&descSA);
plasma_desc_mat_free(&descST);
plasma_desc_mat_free(&descSX) );
464 eps = LAPACKE_dlamch_work(
'e');
531 cte = Anorm*eps*((double) N)*bwdmax;
532 if (Rnorm < Xnorm * cte){
544 for (iiter = 0; iiter < itermax; iiter++){
596 if (Rnorm < Xnorm * cte){
613 *ITER = -itermax - 1;