16 #include "coreblas/lapacke.h" 18 #include "runtime/starpu/chameleon_starpu.h" 20 #include "auxdescutil.h" 24 #include "runtime/starpu/runtime_codelets.h" 25 ZCODELETS_HEADER(potrf_hcore)
28 MORSE_enum
uplo,
int n,
int nb,
29 const MORSE_desc_t *
A,
int Am,
int An,
int lda,
33 struct starpu_codelet *codelet = &cl_zpotrf_hcore;
35 void (*callback)(
void*) = NULL;
37 MORSE_BEGIN_ACCESS_DECLARATION;
38 MORSE_ACCESS_RW(
A, Am, An);
39 MORSE_END_ACCESS_DECLARATION;
41 starpu_mpi_codelet(codelet),
42 STARPU_VALUE, &
uplo,
sizeof(MORSE_enum),
43 STARPU_VALUE, &n,
sizeof(
int),
44 STARPU_RW, RTBLKADDR(
A,
double, Am, An),
45 STARPU_VALUE, &lda,
sizeof(
int),
46 STARPU_VALUE, &iinfo,
sizeof(
int),
47 STARPU_VALUE, &Am,
sizeof(
int),
48 STARPU_VALUE, &An,
sizeof(
int),
50 STARPU_PRIORITY, options->priority,
51 STARPU_CALLBACK, callback,
52 #
if defined(CHAMELEON_CODELETS_HAVE_NAME)
53 STARPU_NAME,
"hcore_zpotrf",
58 #if !defined(CHAMELEON_SIMULATION) 59 static void cl_zpotrf_hcore_cpu_func(
void *descr[],
void *cl_arg)
61 #ifdef HICMA_DISABLE_ALL_COMPUTATIONS 64 struct timeval tvalBefore, tvalAfter;
65 gettimeofday (&tvalBefore, NULL);
76 A = (
double *)STARPU_MATRIX_GET_PTR(descr[0]);
78 starpu_codelet_unpack_args(cl_arg, &
uplo, &n, &lda, &iinfo, &Am, &An);
80 printf(
"%d+POTRF\t|AD(%d,%d)\n",MORSE_My_Mpi_Rank(), Am,An);
83 printf(
"%d\tpotrf-input\n", __LINE__);
87 info = LAPACKE_dpotrf_work(
89 morse_lapack_const(
uplo),
92 printf(
"%d\tpotrf-output\n", __LINE__);
96 fprintf(stderr,
"%s\t|%d\t|Error in LAPACK potrf. info:%d\n", __FILE__, __LINE__, info);
101 printf(
"%.2e ",
A[q*lda+p]);
110 gettimeofday (&tvalAfter, NULL);
111 printf(
"%d-POTRF\t|AD(%d,%d) N:%d LD:%d\t\t\t\t\tPOTRF:%.4f\n",MORSE_My_Mpi_Rank(), Am, An,
113 (tvalAfter.tv_sec - tvalBefore.tv_sec)
114 +(tvalAfter.tv_usec - tvalBefore.tv_usec)/1000000.0
118 char datebuf_start[128];
122 gettimeofday (&tvalAfter, NULL);
131 #ifdef CHAMELEON_USE_MAGMA 132 static void cl_zpotrf_hcore_cuda_func(
void *descr[],
void *cl_arg)
134 cudaStream_t stream[2], currentt_stream;
143 A = (cuDoubleComplex *)STARPU_MATRIX_GET_PTR(descr[0]);
144 starpu_codelet_unpack_args(cl_arg, &
uplo, &n, &lda, &iinfo);
157 CUDA_zpotrf(
uplo, n,
A, lda, &info);
159 cudaThreadSynchronize();
170 #if defined CHAMELEON_USE_MAGMA 171 CODELETS(zpotrf_hcore, 1, cl_zpotrf_hcore_cpu_func, cl_zpotrf_hcore_cuda_func, 0)
173 CODELETS_CPU(zpotrf_hcore, 1, cl_zpotrf_hcore_cpu_func)
void HICMA_TASK_zpotrf(const MORSE_option_t *options, MORSE_enum uplo, int n, int nb, const MORSE_desc_t *A, int Am, int An, int lda, int iinfo)
int HICMA_get_print_mat()
void _printmat(double *A, int m, int n, int ld)
int HICMA_get_print_index_end()
int HICMA_get_print_index()