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
zlauum.c
Go to the documentation of this file.
1 
15 #include "common.h"
16 
17 /***************************************************************************/
66  PLASMA_Complex64_t *A, int LDA)
67 {
68  int NB;
69  int status;
71  PLASMA_sequence *sequence = NULL;
73  PLASMA_desc descA;
74 
75  plasma = plasma_context_self();
76  if (plasma == NULL) {
77  plasma_fatal_error("PLASMA_zlauum", "PLASMA not initialized");
79  }
80  /* Check input arguments */
81  if (uplo != PlasmaUpper && uplo != PlasmaLower) {
82  plasma_error("PLASMA_zlauum", "illegal value of uplo");
83  return -1;
84  }
85  if (N < 0) {
86  plasma_error("PLASMA_zlauum", "illegal value of N");
87  return -2;
88  }
89  if (LDA < max(1, N)) {
90  plasma_error("PLASMA_zlauum", "illegal value of LDA");
91  return -4;
92  }
93  /* Quick return */
94  if (max(N, 0) == 0)
95  return PLASMA_SUCCESS;
96 
97  /* Tune NB depending on M, N & NRHS; Set NBNB */
98  status = plasma_tune(PLASMA_FUNC_ZPOSV, N, N, 0);
99  if (status != PLASMA_SUCCESS) {
100  plasma_error("PLASMA_zlauum", "plasma_tune() failed");
101  return status;
102  }
103 
104  /* Set NT */
105  NB = PLASMA_NB;
106 
107  plasma_sequence_create(plasma, &sequence);
108 
110  plasma_zooplap2tile( descA, A, NB, NB, LDA, N, 0, 0, N, N, plasma_desc_mat_free(&(descA)) );
111  } else {
112  plasma_ziplap2tile( descA, A, NB, NB, LDA, N, 0, 0, N, N);
113  }
114 
115  /* Call the tile interface */
116  PLASMA_zlauum_Tile_Async(uplo, &descA, sequence, &request);
117 
119  plasma_zooptile2lap( descA, A, NB, NB, LDA, N );
121  plasma_desc_mat_free(&descA);
122  } else {
123  plasma_ziptile2lap( descA, A, NB, NB, LDA, N );
125  }
126 
127  status = sequence->status;
128  plasma_sequence_destroy(plasma, sequence);
129  return status;
130 }
131 
132 /***************************************************************************/
173 {
175  PLASMA_sequence *sequence = NULL;
177  int status;
178 
179  plasma = plasma_context_self();
180  if (plasma == NULL) {
181  plasma_fatal_error("PLASMA_zlauum_Tile", "PLASMA not initialized");
183  }
184  plasma_sequence_create(plasma, &sequence);
185  PLASMA_zlauum_Tile_Async(uplo, A, sequence, &request);
187  status = sequence->status;
188  plasma_sequence_destroy(plasma, sequence);
189  return status;
190 }
191 
192 /***************************************************************************/
223  PLASMA_sequence *sequence, PLASMA_request *request)
224 {
225  PLASMA_desc descA = *A;
227 
228  plasma = plasma_context_self();
229  if (plasma == NULL) {
230  plasma_fatal_error("PLASMA_zlauum_Tile", "PLASMA not initialized");
232  }
233  if (sequence == NULL) {
234  plasma_fatal_error("PLASMA_zlauum_Tile", "NULL sequence");
235  return PLASMA_ERR_UNALLOCATED;
236  }
237  if (request == NULL) {
238  plasma_fatal_error("PLASMA_zlauum_Tile", "NULL request");
239  return PLASMA_ERR_UNALLOCATED;
240  }
241  /* Check sequence status */
242  if (sequence->status == PLASMA_SUCCESS)
243  request->status = PLASMA_SUCCESS;
244  else
245  return plasma_request_fail(sequence, request, PLASMA_ERR_SEQUENCE_FLUSHED);
246 
247  /* Check descriptors for correctness */
248  if (plasma_desc_check(&descA) != PLASMA_SUCCESS) {
249  plasma_error("PLASMA_zlauum_Tile", "invalid descriptor");
250  return plasma_request_fail(sequence, request, PLASMA_ERR_ILLEGAL_VALUE);
251  }
252  /* Check input arguments */
253  if (descA.nb != descA.mb) {
254  plasma_error("PLASMA_zlauum_Tile", "only square tiles supported");
255  return plasma_request_fail(sequence, request, PLASMA_ERR_ILLEGAL_VALUE);
256  }
257  if (uplo != PlasmaUpper && uplo != PlasmaLower) {
258  plasma_error("PLASMA_zlauum_Tile", "illegal value of uplo");
259  return plasma_request_fail(sequence, request, -1);
260  }
261  /* Quick return */
262 /*
263  if (max(N, 0) == 0)
264  return PLASMA_SUCCESS;
265 */
266  plasma_dynamic_call_4(plasma_pzlauum,
267  PLASMA_enum, uplo,
268  PLASMA_desc, descA,
269  PLASMA_sequence*, sequence,
270  PLASMA_request*, request);
271 
272  return PLASMA_SUCCESS;
273 }