Newer
Older
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2020 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
* @version 1.0.0
* @comment This file has been automatically generated
* @author Hatem Ltaief
* @author Jakub Kurzak
* @author Mathieu Faverge
* @author Emmanuel Agullo
* @author Cedric Castagnede
* @date 2020-03-03
* @precisions normal z -> c d s
*

Mathieu Faverge
committed
*/
#include "chameleon_starpu.h"
#include "runtime_codelet_z.h"
#if !defined(CHAMELEON_SIMULATION)
static void cl_ztrsm_cpu_func(void *descr[], void *cl_arg)
{
cham_side_t side;
cham_uplo_t uplo;
cham_trans_t transA;
cham_diag_t diag;
int m;
int n;

Mathieu Faverge
committed
CHAM_tile_t *tileA;
CHAM_tile_t *tileB;

Mathieu Faverge
committed
tileA = cti_interface_get(descr[0]);
tileB = cti_interface_get(descr[1]);
starpu_codelet_unpack_args(cl_arg, &side, &uplo, &transA, &diag, &m, &n, &alpha);

Mathieu Faverge
committed
TCORE_ztrsm(side, uplo,

PRUVOST Florent
committed
transA, diag,
m, n,

Mathieu Faverge
committed
alpha, tileA,
tileB);
#ifdef CHAMELEON_USE_CUDA
static void cl_ztrsm_cuda_func(void *descr[], void *cl_arg)
{
cham_side_t side;
cham_uplo_t uplo;
cham_trans_t transA;
cham_diag_t diag;
int m;
int n;
cuDoubleComplex alpha;

Mathieu Faverge
committed
CHAM_tile_t *tileA;
CHAM_tile_t *tileB;

Mathieu Faverge
committed
tileA = cti_interface_get(descr[0]);
tileB = cti_interface_get(descr[1]);
starpu_codelet_unpack_args(cl_arg, &side, &uplo, &transA, &diag, &m, &n, &alpha);

PRUVOST Florent
committed
CUDA_ztrsm(

Mathieu Faverge
committed
side, uplo, transA, diag, m, n, &alpha,
tileA->mat, tileA->ld,
tileB->mat, tileB->ld,
stream );
#ifndef STARPU_CUDA_ASYNC
cudaStreamSynchronize( stream );
#endif
return;
}
#endif /* !defined(CHAMELEON_SIMULATION) */
/*
* Codelet definition
*/
CODELETS(ztrsm, cl_ztrsm_cpu_func, cl_ztrsm_cuda_func, STARPU_CUDA_ASYNC)
/**
*
* @ingroup INSERT_TASK_Complex64_t
*
*/
void INSERT_TASK_ztrsm(const RUNTIME_option_t *options,
cham_side_t side, cham_uplo_t uplo, cham_trans_t transA, cham_diag_t diag,
int m, int n, int nb,

Mathieu Faverge
committed
CHAMELEON_Complex64_t alpha, const CHAM_desc_t *A, int Am, int An,
const CHAM_desc_t *B, int Bm, int Bn)
{
(void)nb;
struct starpu_codelet *codelet = &cl_ztrsm;
void (*callback)(void*) = options->profiling ? cl_ztrsm_callback : NULL;

PRUVOST Florent
committed
starpu_option_request_t* schedopt = (starpu_option_request_t *)(options->request->schedopt);
int workerid = (schedopt == NULL) ? -1 : schedopt->workerid;
CHAMELEON_BEGIN_ACCESS_DECLARATION;
CHAMELEON_ACCESS_R(A, Am, An);
CHAMELEON_ACCESS_RW(B, Bm, Bn);
CHAMELEON_END_ACCESS_DECLARATION;

Mathieu Faverge
committed
rt_starpu_insert_task(
codelet,
STARPU_VALUE, &side, sizeof(int),
STARPU_VALUE, &uplo, sizeof(int),
STARPU_VALUE, &transA, sizeof(int),
STARPU_VALUE, &diag, sizeof(int),
STARPU_VALUE, &m, sizeof(int),
STARPU_VALUE, &n, sizeof(int),
STARPU_VALUE, &alpha, sizeof(CHAMELEON_Complex64_t),
STARPU_R, RTBLKADDR(A, CHAMELEON_Complex64_t, Am, An),
STARPU_RW, RTBLKADDR(B, CHAMELEON_Complex64_t, Bm, Bn),
STARPU_PRIORITY, options->priority,
STARPU_CALLBACK, callback,

PRUVOST Florent
committed
STARPU_EXECUTE_ON_WORKER, workerid,
#if defined(CHAMELEON_CODELETS_HAVE_NAME)
STARPU_NAME, "ztrsm",
#endif
0);
}