20 #include "../include/starpu_exageostat.h" 21 static void CORE_dmse_starpu(
void *buffers[],
void *cl_arg){
26 double local_serror = 0.0;
28 serror = (
double *)STARPU_MATRIX_GET_PTR(buffers[0]);
29 zpre = (
double *)STARPU_MATRIX_GET_PTR(buffers[1]);
30 zmiss = (
double *)STARPU_MATRIX_GET_PTR(buffers[2]);
32 starpu_codelet_unpack_args(cl_arg, &m, &m0);
34 for(i = 0; i < m; i++)
37 local_serror += pow((zpre[i]-zmiss[i]), 2);
40 *serror += local_serror;
43 static struct starpu_codelet cl_dmse =
46 .cpu_funcs = {CORE_dmse_starpu},
48 .modes = {STARPU_RW,STARPU_R,STARPU_R},
91 int MORSE_MLE_dmse_Tile_Async(MORSE_desc_t *descZpre, MORSE_desc_t *descZmiss, MORSE_desc_t *descserror, MORSE_sequence_t *sequence, MORSE_request_t *request){
92 MORSE_context_t *morse;
93 MORSE_option_t options;
94 morse = morse_context_self();
95 if (sequence->status != MORSE_SUCCESS)
97 RUNTIME_options_init(&options, morse, sequence, request);
101 MORSE_desc_t Zpre = *descZpre;
102 struct starpu_codelet *cl=&cl_dmse;
105 for (m = 0; m < Zpre.mt; m++) {
106 tempmm = m == Zpre.mt-1 ? Zpre.m - m * Zpre.mb : Zpre.mb;
111 STARPU_VALUE, &tempmm,
sizeof(
int),
112 STARPU_VALUE, &m0,
sizeof(
int),
113 STARPU_RW,
RTBLKADDR(descserror,
sizeof(
double), 0, 0),
114 STARPU_R,
RTBLKADDR(descZpre,
sizeof(
double)*tempmm, m, 0),
115 STARPU_R,
RTBLKADDR(descZmiss,
sizeof(
double)*tempmm, m, 0),
116 #
if defined(CHAMELEON_CODELETS_HAVE_NAME)
125 RUNTIME_options_ws_free(&options);
126 RUNTIME_options_finalize(&options, morse);
128 MORSE_Sequence_Wait(sequence);
129 return MORSE_SUCCESS;
#define RTBLKADDR(desc, type, m, n)
#define starpu_mpi_codelet(_codelet_)
int MORSE_MLE_dmse_Tile_Async(MORSE_desc_t *descZpre, MORSE_desc_t *descZmiss, MORSE_desc_t *descserror, MORSE_sequence_t *sequence, MORSE_request_t *request)