17 #include "runtime/starpu/chameleon_starpu.h" 22 #include "runtime/starpu/runtime_codelets.h" 23 ZCODELETS_HEADER(syrk_hcore)
36 extern void _printmat(
double *
A, int64_t m, int64_t n, int64_t ld);
47 const MORSE_desc_t *
AUV,
int ldauv,
48 const MORSE_desc_t *Ark,
51 const MORSE_desc_t *CD,
int ldcd,
56 struct starpu_codelet *codelet = &cl_zsyrk_hcore;
58 void (*callback)(
void*) = NULL;
59 MORSE_starpu_ws_t *h_work = (MORSE_starpu_ws_t*)(options->ws_host);
61 MORSE_BEGIN_ACCESS_DECLARATION;
62 MORSE_ACCESS_R(
AUV, Am, An);
63 #if !defined(HICMA_ALWAYS_FIX_RANK) 64 MORSE_ACCESS_R(Ark, Am, An);
66 MORSE_ACCESS_RW(CD, Cm, Cn);
67 MORSE_END_ACCESS_DECLARATION;
69 starpu_mpi_codelet(codelet),
70 STARPU_VALUE, &
uplo,
sizeof(MORSE_enum),
71 STARPU_VALUE, &
trans,
sizeof(MORSE_enum),
72 STARPU_VALUE, &n,
sizeof(
int),
73 STARPU_VALUE, &alpha,
sizeof(
double),
74 STARPU_R, RTBLKADDR(
AUV,
double, Am, An),
75 STARPU_VALUE, &ldauv,
sizeof(
int),
76 #
if !defined(HICMA_ALWAYS_FIX_RANK)
77 STARPU_R, RTBLKADDR(Ark,
double, Am, An),
79 STARPU_VALUE, &beta,
sizeof(
double),
80 STARPU_RW, RTBLKADDR(CD,
double, Cm, Cn),
81 STARPU_VALUE, &ldcd,
sizeof(
int),
82 STARPU_VALUE, &Am,
sizeof(
int),
83 STARPU_VALUE, &An,
sizeof(
int),
84 STARPU_VALUE, &Cm,
sizeof(
int),
85 STARPU_VALUE, &Cn,
sizeof(
int),
86 STARPU_VALUE, &nAUV,
sizeof(
int),
87 STARPU_SCRATCH, options->ws_worker,
88 STARPU_VALUE, &h_work,
sizeof(MORSE_starpu_ws_t *),
89 STARPU_PRIORITY, options->priority,
90 STARPU_CALLBACK, callback,
91 #
if defined(CHAMELEON_CODELETS_HAVE_NAME)
92 STARPU_NAME,
"hcore_zsyrk",
98 #if !defined(CHAMELEON_SIMULATION) 99 static void cl_zsyrk_hcore_cpu_func(
void *descr[],
void *cl_arg)
101 #ifdef HICMA_DISABLE_ALL_COMPUTATIONS 104 #ifdef HICMA_DISABLE_HCORE_COMPUTATIONS 107 struct timeval tvalBefore, tvalAfter;
108 gettimeofday (&tvalBefore, NULL);
123 AUV = (
double *)STARPU_MATRIX_GET_PTR(descr[idescr++]);
124 #if !defined(HICMA_ALWAYS_FIX_RANK) 125 Ark = (
double *)STARPU_MATRIX_GET_PTR(descr[idescr++]);
127 fprintf(stderr,
"global_always_fixed_rank is one. But HICMA_ALWAYS_FIX_RANK is not defined. Exiting...\n");
142 CD = (
double *)STARPU_MATRIX_GET_PTR(descr[idescr++]);
144 work = (
double *)STARPU_MATRIX_GET_PTR(descr[idescr++]);
145 MORSE_starpu_ws_t *h_work;
146 starpu_codelet_unpack_args(cl_arg, &
uplo, &
trans, &n, &alpha, &ldauv, &beta, &ldcd, &Am, &An, &Cm, &Cn, &nAUV, &h_work);
149 size_t nelm_AU = (size_t)ldauv * (
size_t)nAU;
150 double *AV = &(
AUV[nelm_AU]);
155 printf(
"%d+SYRK\t|CD(%d,%d) AUV(%d,%d)%d N:%d\n",MORSE_My_Mpi_Rank(),Cm, Cn, Am, An, _Ark, n);
158 printf(
"%d\tsyrk-input\n");
178 gettimeofday (&tvalAfter, NULL);
179 printf(
"%d-SYRK\t|CD(%d,%d) AUV(%d,%d)%d N:%d LDA:%d LDCD:%d\t\t\t\t\tSYRK:%.4f\n",MORSE_My_Mpi_Rank(),Cm, Cn, Am, An, _Ark, n,
181 (tvalAfter.tv_sec - tvalBefore.tv_sec)
182 +(tvalAfter.tv_usec - tvalBefore.tv_usec)/1000000.0
186 printf(
"%d\tsyrk-output\n");
195 #if defined(HICMA_ALWAYS_FIX_RANK) 196 CODELETS_CPU(zsyrk_hcore, 3, cl_zsyrk_hcore_cpu_func)
199 CODELETS_CPU(zsyrk_hcore, 4, cl_zsyrk_hcore_cpu_func)
void _printmat(double *A, int64_t m, int64_t n, int64_t ld)
void HCORE_zsyrk(MORSE_enum uplo, MORSE_enum trans, int M, int K, double alpha, const double *AU, int LDAU, const double *AV, int LDAV, double beta, double *CD, int LDCD, double *work)
int global_always_fixed_rank
void HICMA_TASK_zsyrk(const MORSE_option_t *options, MORSE_enum uplo, MORSE_enum trans, int n, int nb, double alpha, const MORSE_desc_t *AUV, int ldauv, const MORSE_desc_t *Ark, int Am, int An, double beta, const MORSE_desc_t *CD, int ldcd, int Cm, int Cn)