Mentions légales du service

Skip to content
Snippets Groups Projects
Commit cabbcdbe authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

starpu/codelet: Add new task submit to codelet_zsyrk.c

parent cd9b564a
No related branches found
No related tags found
1 merge request!512Restructuration of the codelets
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include "runtime_codelet_z.h" #include "runtime_codelet_z.h"
struct cl_zsyrk_args_s { struct cl_zsyrk_args_s {
cham_uplo_t uplo; cham_uplo_t uplo;
cham_trans_t trans; cham_trans_t trans;
int n; int n;
int k; int k;
CHAMELEON_Complex64_t alpha; CHAMELEON_Complex64_t alpha;
CHAMELEON_Complex64_t beta; CHAMELEON_Complex64_t beta;
}; };
...@@ -110,6 +110,7 @@ CODELETS_GPU( zsyrk, cl_zsyrk_cpu_func, cl_zsyrk_hip_func, STARPU_HIP_ASYNC ) ...@@ -110,6 +110,7 @@ CODELETS_GPU( zsyrk, cl_zsyrk_cpu_func, cl_zsyrk_hip_func, STARPU_HIP_ASYNC )
CODELETS( zsyrk, cl_zsyrk_cpu_func, cl_zsyrk_cuda_func, STARPU_CUDA_ASYNC ) CODELETS( zsyrk, cl_zsyrk_cpu_func, cl_zsyrk_cuda_func, STARPU_CUDA_ASYNC )
#endif #endif
#if defined(CHAMELEON_STARPU_USE_INSERT)
void INSERT_TASK_zsyrk( const RUNTIME_option_t *options, void INSERT_TASK_zsyrk( const RUNTIME_option_t *options,
cham_uplo_t uplo, cham_trans_t trans, cham_uplo_t uplo, cham_trans_t trans,
int n, int k, int nb, int n, int k, int nb,
...@@ -122,11 +123,11 @@ void INSERT_TASK_zsyrk( const RUNTIME_option_t *options, ...@@ -122,11 +123,11 @@ void INSERT_TASK_zsyrk( const RUNTIME_option_t *options,
return; return;
} }
struct cl_zsyrk_args_s *clargs = NULL;
void (*callback)(void*); void (*callback)(void*);
int accessC; struct cl_zsyrk_args_s *clargs = NULL;
int exec = 0; int exec = 0;
const char *cl_name = "zsyrk"; const char *cl_name = "zsyrk";
int accessC;
/* Handle cache */ /* Handle cache */
CHAMELEON_BEGIN_ACCESS_DECLARATION; CHAMELEON_BEGIN_ACCESS_DECLARATION;
...@@ -174,3 +175,83 @@ void INSERT_TASK_zsyrk( const RUNTIME_option_t *options, ...@@ -174,3 +175,83 @@ void INSERT_TASK_zsyrk( const RUNTIME_option_t *options,
(void)nb; (void)nb;
} }
#else
void INSERT_TASK_zsyrk( const RUNTIME_option_t *options,
cham_uplo_t uplo, cham_trans_t trans,
int n, int k, int nb,
CHAMELEON_Complex64_t alpha, const CHAM_desc_t *A, int Am, int An,
CHAMELEON_Complex64_t beta, const CHAM_desc_t *C, int Cm, int Cn )
{
if ( alpha == 0. ) {
INSERT_TASK_zlascal( options, uplo, n, n, nb,
beta, C, Cm, Cn );
return;
}
INSERT_TASK_COMMON_PARAMETERS( zsyrk, 2 );
int accessC;
/* Reduce the C access if needed */
accessC = ( beta == (CHAMELEON_Complex64_t)0. ) ? STARPU_W : STARPU_RW;
/*
* Set the data handles and initialize exchanges if needed
*/
starpu_cham_exchange_init_params( options, &params, C->get_rankof( C, Cm, Cn ) );
starpu_cham_exchange_data_before_execution( options, params, &nbdata, descrs, A, Am, An, STARPU_R );
starpu_cham_exchange_data_before_execution( options, params, &nbdata, descrs, C, Cm, Cn, accessC );
/*
* Not involved, let's return
*/
if ( nbdata == 0 ) {
return;
}
if ( params.do_execute )
{
int ret;
struct starpu_task *task = starpu_task_create();
task->cl = cl;
/* Set codelet parameters */
clargs = malloc( sizeof( struct cl_zsyrk_args_s ) );
clargs->uplo = uplo;
clargs->trans = trans;
clargs->n = n;
clargs->k = k;
clargs->alpha = alpha;
clargs->beta = beta;
task->cl_arg = clargs;
task->cl_arg_size = sizeof( struct cl_zsyrk_args_s );
task->cl_arg_free = 1;
/* Set common parameters */
starpu_cham_task_set_options( options, task, nbdata, descrs, cl_zsyrk_callback );
/* Flops */
task->flops = flops_zsyrk( k, n );
/* Refine name */
task->name = chameleon_codelet_name( cl_name, 2,
A->get_blktile( A, Am, An ),
C->get_blktile( C, Cm, Cn ) );
ret = starpu_task_submit( task );
if ( ret == -ENODEV ) {
task->destroy = 0;
starpu_task_destroy( task );
chameleon_error( "INSERT_TASK_zsyrk", "Failed to submit the task to StarPU" );
return;
}
}
starpu_cham_task_exchange_data_after_execution( options, params, nbdata, descrs );
(void)nb;
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment