HiCMA
Hierarchical Computations on Manycore Architectures
zhagdm.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 
58  MORSE_enum uplo,
59  MORSE_desc_t *Dense
60  )
61 {
62  MORSE_context_t *morse;
63  MORSE_sequence_t *sequence = NULL;
64  MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
65  int status;
66 
67  morse = morse_context_self();
68  if (morse == NULL) {
69  morse_fatal_error("MORSE_zhagdm_Tile", "morse not initialized");
70  return MORSE_ERR_NOT_INITIALIZED;
71  }
72  morse_sequence_create(morse, &sequence);
74  uplo,
75  Dense,
76  sequence, &request );
77  MORSE_Desc_Flush( Dense, sequence );
78  morse_sequence_wait(morse, sequence);
79  /*RUNTIME_desc_getoncpu(Dense);*/
80  status = sequence->status;
81  morse_sequence_destroy(morse, sequence);
82  return status;
83 }
84 
102  MORSE_enum uplo,
103  MORSE_desc_t *Dense,
104  MORSE_sequence_t *sequence,
105  MORSE_request_t *request)
106 {
107  MORSE_context_t *morse;
108 
109  morse = morse_context_self();
110  if (morse == NULL) {
111  morse_fatal_error("MORSE_zhagdm_Tile", "morse not initialized");
112  return MORSE_ERR_NOT_INITIALIZED;
113  }
114  if (sequence == NULL) {
115  morse_fatal_error("MORSE_zhagdm_Tile", "NULL sequence");
116  return MORSE_ERR_UNALLOCATED;
117  }
118  if (request == NULL) {
119  morse_fatal_error("MORSE_zhagdm_Tile", "NULL request");
120  return MORSE_ERR_UNALLOCATED;
121  }
122  /* Check sequence status */
123  if (sequence->status == MORSE_SUCCESS)
124  request->status = MORSE_SUCCESS;
125  else
126  return morse_request_fail(sequence, request, MORSE_ERR_SEQUENCE_FLUSHED);
127 
128  /* Check descriptors for correctness */
129  if (morse_desc_check(Dense) != MORSE_SUCCESS) {
130  morse_error("MORSE_zhagdm_Tile", "invalid descriptor");
131  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
132  }
133  /* Check input arguments */
134  /*if (A->nb != A->mb) {
135  morse_error("MORSE_zhagdm_Tile", "only square tiles supported");
136  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
137  }*/
138 
139  /* Quick return */
140  if (chameleon_min( Dense->m, Dense->n ) == 0)
141  return MORSE_SUCCESS;
142 
144  uplo,
145  Dense,
146  sequence, request);
147 
148  return MORSE_SUCCESS;
149 }
150 
163  MORSE_enum uplo,
164  MORSE_desc_t *Dense
165  )
166 {
167  MORSE_context_t *morse;
168  MORSE_sequence_t *sequence = NULL;
169  MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
170  int status;
171 
172  morse = morse_context_self();
173  if (morse == NULL) {
174  morse_fatal_error("MORSE_zhagdm_Tile", "morse not initialized");
175  return MORSE_ERR_NOT_INITIALIZED;
176  }
177  morse_sequence_create(morse, &sequence);
179  uplo,
180  Dense,
181  sequence, &request );
182  MORSE_Desc_Flush( Dense, sequence );
183  morse_sequence_wait(morse, sequence);
184  /*RUNTIME_desc_getoncpu(Dense);*/
185  status = sequence->status;
186  morse_sequence_destroy(morse, sequence);
187  return status;
188 }
189 
208  MORSE_enum uplo,
209  MORSE_desc_t *Dense,
210  MORSE_sequence_t *sequence,
211  MORSE_request_t *request)
212 {
213  MORSE_context_t *morse;
214 
215  morse = morse_context_self();
216  if (morse == NULL) {
217  morse_fatal_error("MORSE_zhagdm_Tile", "morse not initialized");
218  return MORSE_ERR_NOT_INITIALIZED;
219  }
220  if (sequence == NULL) {
221  morse_fatal_error("MORSE_zhagdm_Tile", "NULL sequence");
222  return MORSE_ERR_UNALLOCATED;
223  }
224  if (request == NULL) {
225  morse_fatal_error("MORSE_zhagdm_Tile", "NULL request");
226  return MORSE_ERR_UNALLOCATED;
227  }
228  /* Check sequence status */
229  if (sequence->status == MORSE_SUCCESS)
230  request->status = MORSE_SUCCESS;
231  else
232  return morse_request_fail(sequence, request, MORSE_ERR_SEQUENCE_FLUSHED);
233 
234  /* Check descriptors for correctness */
235  if (morse_desc_check(Dense) != MORSE_SUCCESS) {
236  morse_error("MORSE_zhagdm_Tile", "invalid descriptor");
237  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
238  }
239  /* Check input arguments */
240  /*if (A->nb != A->mb) {
241  morse_error("MORSE_zhagdm_Tile", "only square tiles supported");
242  return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
243  }*/
244 
245  /* Quick return */
246  if (chameleon_min( Dense->m, Dense->n ) == 0)
247  return MORSE_SUCCESS;
248 
250  uplo,
251  Dense,
252  sequence, request);
253 
254  return MORSE_SUCCESS;
255 }
256 
void hicma_pzhagdmdiag(MORSE_enum uplo, MORSE_desc_t *Dense, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: pzhagdm.c:91
int HICMA_zhagdmdiag_Tile_Async(MORSE_enum uplo, MORSE_desc_t *Dense, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: zhagdm.c:207
int HICMA_zhagdm_Tile_Async(MORSE_enum uplo, MORSE_desc_t *Dense, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: zhagdm.c:101
void hicma_pzhagdm(MORSE_enum uplo, MORSE_desc_t *Dense, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: pzhagdm.c:46
int HICMA_zhagdm_Tile(MORSE_enum uplo, MORSE_desc_t *Dense)
Definition: zhagdm.c:57
int HICMA_zhagdmdiag_Tile(MORSE_enum uplo, MORSE_desc_t *Dense)
Definition: zhagdm.c:162
int uplo[2]