HiCMA
Hierarchical Computations on Manycore Architectures
zhagcm.c
Go to the documentation of this file.
1 
43 #include "morse.h"
44 #include "control/common.h"
45 #include "control/hicma_common.h"
46 
93  MORSE_enum uplo,
94  MORSE_desc_t *AUV,
95  MORSE_desc_t *Ark,
96  int numrows_matrix,
97  int numcols_matrix,
98  int numrows_block,
99  int numcols_block,
100  int maxrank,
101  double tol
102  )
103 {
104  MORSE_context_t *morse;
105  MORSE_sequence_t *sequence = NULL;
106  MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
107  int status;
108 
109  morse = morse_context_self();
110  if (morse == NULL) {
111  morse_fatal_error("MORSE_zhagcm_Tile", "morse not initialized");
112  return MORSE_ERR_NOT_INITIALIZED;
113  }
114  morse_sequence_create(morse, &sequence);
116  uplo,
117  AUV,
118  Ark,
119  numrows_matrix,
120  numcols_matrix,
121  numrows_block,
122  numcols_block,
123  maxrank, tol,
124  sequence, &request );
125  morse_sequence_wait(morse, sequence);
126  //RUNTIME_desc_getoncpu(AD);
127  status = sequence->status;
128  morse_sequence_destroy(morse, sequence);
129  return status;
130 }
131 
150  MORSE_enum uplo,
151  MORSE_desc_t *AUV,
152  MORSE_desc_t *Ark,
153  int numrows_matrix,
154  int numcols_matrix,
155  int numrows_block,
156  int numcols_block,
157  int maxrank, double tol,
158  MORSE_sequence_t *sequence,
159  MORSE_request_t *request)
160 {
161  MORSE_desc_t *A = AUV; // FIXME
162 
163  MORSE_context_t *morse;
164 
165  morse = morse_context_self();
166  if (morse == NULL) {
167  morse_fatal_error("MORSE_zhagcm_Tile", "morse not initialized");
168  return MORSE_ERR_NOT_INITIALIZED;
169  }
170  if (sequence == NULL) {
171  morse_fatal_error("MORSE_zhagcm_Tile", "NULL sequence");
172  return MORSE_ERR_UNALLOCATED;
173  }
174  if (request == NULL) {
175  morse_fatal_error("MORSE_zhagcm_Tile", "NULL request");
176  return MORSE_ERR_UNALLOCATED;
177  }
178  /* Check sequence status */
179  if (sequence->status == MORSE_SUCCESS)
180  request->status = MORSE_SUCCESS;
181  else
182  return morse_request_fail(sequence, request, MORSE_ERR_SEQUENCE_FLUSHED);
183 
184  /* Check descriptors for correctness */
185  if (morse_desc_check(A) != MORSE_SUCCESS) {
186  morse_error("MORSE_zhagcm_Tile", "invalid descriptor");
187  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
188  }
189  /* Check input arguments */
190  /*if (A->nb != A->mb) {
191  morse_error("MORSE_zhagcm_Tile", "only square tiles supported");
192  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
193  }*/
194 
195  /* Quick return */
196  if (chameleon_min( A->m, A->n ) == 0)
197  return MORSE_SUCCESS;
198 
200  uplo,
201  AUV,
202  Ark,
203  numrows_matrix,
204  numcols_matrix,
205  numrows_block,
206  numcols_block,
207  maxrank, tol,
208  sequence, request);
209 
210  return MORSE_SUCCESS;
211 }
#define AUV(m, n)
Definition: pzgemm.c:60
#define A(m, n)
Definition: pzgemm.c:56
void hicma_pzhagcm(MORSE_enum uplo, MORSE_desc_t *AUV, MORSE_desc_t *Ark, int numrows_matrix, int numcols_matrix, int numrows_block, int numcols_block, int maxrank, double tol, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: pzhagcm.c:46
int HICMA_zhagcm_Tile_Async(MORSE_enum uplo, MORSE_desc_t *AUV, MORSE_desc_t *Ark, int numrows_matrix, int numcols_matrix, int numrows_block, int numcols_block, int maxrank, double tol, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: zhagcm.c:149
int uplo[2]
int HICMA_zhagcm_Tile(MORSE_enum uplo, MORSE_desc_t *AUV, MORSE_desc_t *Ark, int numrows_matrix, int numcols_matrix, int numrows_block, int numcols_block, int maxrank, double tol)
Definition: zhagcm.c:92