Commit 95826f37 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Update codelets to new PaRSEC DTD interface

parent 75fd8816
/**
*
* @copyright (c) 2009-2015 The University of Tennessee and The University
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2015 Inria. All rights reserved.
* @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* MORSE codelets kernel
* MORSE is a software package provided by Univ. of Tennessee,
* Univ. of California Berkeley and Univ. of Colorado Denver
*
* @version 2.5.0
* @author Reazul Hoque
* @precisions normal z -> c d s
*
**/
#include "chameleon_parsec.h"
#include "chameleon/morse_tasks.h"
void MORSE_TASK_flush_data( const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An )
{
parsec_taskpool_t* PARSEC_dtd_taskpool = (parsec_taskpool_t *)(options->sequence->schedopt);
parsec_dtd_data_flush( PARSEC_dtd_taskpool, RTBLKADDR( A, MORSE_Complex64_t, Am, An ) );
}
void MORSE_TASK_flush_desc( const MORSE_option_t *options,
MORSE_enum uplo, const MORSE_desc_t *A )
{
/* parsec_taskpool_t* PARSEC_dtd_taskpool = (parsec_taskpool_t *)(options->sequence->schedopt); */
/* parsec_dtd_data_flush_all( PARSEC_dtd_taskpool, (parsec_data_collection_t*)(A->schedopt) ); */
(void)options;
(void)uplo;
(void)A;
}
void MORSE_TASK_flush_all()
{
}
......@@ -28,28 +28,21 @@ static inline int
CORE_dzasum_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
MORSE_enum *storev;
MORSE_enum *uplo;
int *M;
int *N;
MORSE_enum storev;
MORSE_enum uplo;
int M;
int N;
MORSE_Complex64_t *A;
int *lda;
int lda;
double *work;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &storev,
UNPACK_VALUE, &uplo,
UNPACK_VALUE, &M,
UNPACK_VALUE, &N,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_DATA, &work );
this_task, &storev, &uplo, &M, &N, &A, &lda, &work );
CORE_dzasum(*storev, *uplo, *M, *N, A, *lda, work);
CORE_dzasum( storev, uplo, M, N, A, lda, work );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_dzasum(const MORSE_option_t *options,
......@@ -68,5 +61,5 @@ void MORSE_TASK_dzasum(const MORSE_option_t *options,
PASSED_BY_REF, RTBLKADDR( A, MORSE_Complex64_t, Am, An ), INPUT,
sizeof(int), &lda, VALUE,
PASSED_BY_REF, RTBLKADDR( B, double, Bm, Bn ), INOUT,
0);
PARSEC_DTD_ARG_END );
}
......@@ -28,30 +28,24 @@ static inline int
CORE_zaxpy_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *M;
MORSE_Complex64_t *alpha;
int M;
MORSE_Complex64_t alpha;
MORSE_Complex64_t *A;
int *incA;
int incA;
MORSE_Complex64_t *B;
int *incB;
int incB;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &M,
UNPACK_VALUE, &alpha,
UNPACK_DATA, &A,
UNPACK_VALUE, &incA,
UNPACK_DATA, &B,
UNPACK_VALUE, &incB );
this_task, &M, &alpha, &A, &incA, &B, &incB );
CORE_zaxpy(*M, *alpha, A, *incA, B, *incB);
CORE_zaxpy( M, alpha, A, incA, B, incB );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zaxpy(const MORSE_option_t *options,
int M, MORSE_Complex64_t *alpha,
int M, MORSE_Complex64_t alpha,
const MORSE_desc_t *A, int Am, int An, int incA,
const MORSE_desc_t *B, int Bm, int Bn, int incB)
{
......@@ -65,5 +59,5 @@ void MORSE_TASK_zaxpy(const MORSE_option_t *options,
sizeof(int), &incA, VALUE,
PASSED_BY_REF, RTBLKADDR( B, MORSE_Complex64_t, Bm, Bn ), INOUT,
sizeof(int), &incB, VALUE,
0);
PARSEC_DTD_ARG_END );
}
......@@ -33,25 +33,17 @@ CORE_zbuild_parsec( parsec_execution_stream_t *context,
MORSE_Complex64_t *A;
int lda;
void *user_data;
void (*user_build_callback)(int row_min, int row_max, int col_min, int col_max, void *buffer, int ld, void *user_data) ;
void (*user_build_callback)( int row_min, int row_max, int col_min, int col_max,
void *buffer, int ld, void *user_data );
int row_min, row_max, col_min, col_max;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &row_min,
UNPACK_VALUE, &row_max,
UNPACK_VALUE, &col_min,
UNPACK_VALUE, &col_max,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_VALUE, &user_data,
UNPACK_VALUE, &user_build_callback );
this_task, &row_min, &row_max, &col_min, &col_max, &A, &lda, &user_data, &user_build_callback );
user_build_callback(row_min, row_max, col_min, col_max, A, lda, user_data);
(void)context;
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zbuild( const MORSE_option_t *options,
......@@ -75,5 +67,5 @@ void MORSE_TASK_zbuild( const MORSE_option_t *options,
sizeof(int), &lda, VALUE,
sizeof(void*), &user_data, VALUE,
sizeof(void*), &user_build_callback, VALUE,
0);
PARSEC_DTD_ARG_END );
}
......@@ -33,32 +33,23 @@ static inline int
CORE_zgeadd_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
MORSE_enum *trans;
int *M;
int *N;
MORSE_Complex64_t *alpha;
MORSE_enum trans;
int M;
int N;
MORSE_Complex64_t alpha;
MORSE_Complex64_t *A;
int *LDA;
MORSE_Complex64_t *beta;
int LDA;
MORSE_Complex64_t beta;
MORSE_Complex64_t *B;
int *LDB;
int LDB;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &trans,
UNPACK_VALUE, &M,
UNPACK_VALUE, &N,
UNPACK_VALUE, &alpha,
UNPACK_DATA, &A,
UNPACK_VALUE, &LDA,
UNPACK_VALUE, &beta,
UNPACK_DATA, &B,
UNPACK_VALUE, &LDB );
this_task, &trans, &M, &N, &alpha, &A, &LDA, &beta, &B, &LDB );
CORE_zgeadd(*trans, *M, *N, *alpha, A, *LDA, *beta, B, *LDB);
CORE_zgeadd( trans, M, N, alpha, A, LDA, beta, B, LDB );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
/**
......@@ -133,7 +124,7 @@ void MORSE_TASK_zgeadd(const MORSE_option_t *options,
sizeof(MORSE_Complex64_t), &beta, VALUE,
PASSED_BY_REF, RTBLKADDR( B, MORSE_Complex64_t, Bm, Bn ), INOUT,
sizeof(int), &ldb, VALUE,
0);
PARSEC_DTD_ARG_END );
(void)nb;
}
......@@ -89,32 +89,23 @@ static inline int
CORE_zgelqt_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int *ib;
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int *lda;
int lda;
MORSE_Complex64_t *T;
int *ldt;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_VALUE, &ib,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_DATA, &T,
UNPACK_VALUE, &ldt,
UNPACK_SCRATCH, &TAU,
UNPACK_SCRATCH, &WORK );
this_task, &m, &n, &ib, &A, &lda, &T, &ldt, &TAU, &WORK );
CORE_zgelqt(*m, *n, *ib, A, *lda, T, *ldt, TAU, WORK);
CORE_zgelqt( m, n, ib, A, lda, T, ldt, TAU, WORK );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgelqt(const MORSE_option_t *options,
......@@ -135,5 +126,5 @@ void MORSE_TASK_zgelqt(const MORSE_option_t *options,
sizeof(int), &ldt, VALUE,
sizeof(MORSE_Complex64_t)*nb, NULL, SCRATCH,
sizeof(MORSE_Complex64_t)*ib*nb, NULL, SCRATCH,
0);
PARSEC_DTD_ARG_END );
}
......@@ -33,51 +33,38 @@ static inline int
CORE_zgemm_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
MORSE_enum *transA;
MORSE_enum *transB;
int *m;
int *n;
int *k;
MORSE_Complex64_t *alpha;
MORSE_enum transA;
MORSE_enum transB;
int m;
int n;
int k;
MORSE_Complex64_t alpha;
MORSE_Complex64_t *A;
int *lda;
int lda;
MORSE_Complex64_t *B;
int *ldb;
MORSE_Complex64_t *beta;
int ldb;
MORSE_Complex64_t beta;
MORSE_Complex64_t *C;
int *ldc;
int ldc;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &transA,
UNPACK_VALUE, &transB,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_VALUE, &k,
UNPACK_VALUE, &alpha,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_DATA, &B,
UNPACK_VALUE, &ldb,
UNPACK_VALUE, &beta,
UNPACK_DATA, &C,
UNPACK_VALUE, &ldc );
this_task, &transA, &transB, &m, &n, &k, &alpha, &A, &lda, &B, &ldb, &beta, &C, &ldc );
CORE_zgemm(*transA, *transB, *m, *n, *k,
*alpha, A, *lda,
B, *ldb,
*beta, C, *ldc);
CORE_zgemm( transA, transB, m, n, k,
alpha, A, lda,
B, ldb,
beta, C, ldc);
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgemm(const MORSE_option_t *options,
MORSE_enum transA, int transB,
int m, int n, int k, int nb,
MORSE_Complex64_t alpha, const MORSE_desc_t *A, int Am, int An, int lda,
void MORSE_TASK_zgemm( const MORSE_option_t *options,
MORSE_enum transA, int transB,
int m, int n, int k, int nb,
MORSE_Complex64_t alpha, const MORSE_desc_t *A, int Am, int An, int lda,
const MORSE_desc_t *B, int Bm, int Bn, int ldb,
MORSE_Complex64_t beta, const MORSE_desc_t *C, int Cm, int Cn, int ldc)
MORSE_Complex64_t beta, const MORSE_desc_t *C, int Cm, int Cn, int ldc )
{
parsec_taskpool_t* PARSEC_dtd_taskpool = (parsec_taskpool_t *)(options->sequence->schedopt);
......@@ -96,7 +83,7 @@ void MORSE_TASK_zgemm(const MORSE_option_t *options,
sizeof(MORSE_Complex64_t), &beta, VALUE,
PASSED_BY_REF, RTBLKADDR( C, MORSE_Complex64_t, Cm, Cn ), INOUT | morse_parsec_get_arena_index(C) | AFFINITY,
sizeof(int), &ldc, VALUE,
0);
PARSEC_DTD_ARG_END );
(void)nb;
}
......@@ -90,32 +90,23 @@ static inline int
CORE_zgeqrt_parsec ( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int *ib;
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int *lda;
int lda;
MORSE_Complex64_t *T;
int *ldt;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_VALUE, &ib,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_DATA, &T,
UNPACK_VALUE, &ldt,
UNPACK_SCRATCH, &TAU,
UNPACK_SCRATCH, &WORK );
this_task, &m, &n, &ib, &A, &lda, &T, &ldt, &TAU, &WORK );
CORE_zgeqrt(*m, *n, *ib, A, *lda, T, *ldt, TAU, WORK);
CORE_zgeqrt( m, n, ib, A, lda, T, ldt, TAU, WORK );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgeqrt(const MORSE_option_t *options,
......@@ -136,5 +127,5 @@ void MORSE_TASK_zgeqrt(const MORSE_option_t *options,
sizeof(int), &ldt, VALUE,
sizeof(MORSE_Complex64_t)*nb, NULL, SCRATCH,
sizeof(MORSE_Complex64_t)*ib*nb, NULL, SCRATCH,
0);
PARSEC_DTD_ARG_END );
}
......@@ -73,41 +73,29 @@ static inline int
CORE_zgessm_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int *k;
int *ib;
int m;
int n;
int k;
int ib;
int *IPIV;
MORSE_Complex64_t *L;
int *ldl;
int ldl;
MORSE_Complex64_t *D;
int *ldd;
int ldd;
MORSE_Complex64_t *A;
int *lda;
int lda;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_VALUE, &k,
UNPACK_VALUE, &ib,
UNPACK_SCRATCH, &IPIV,
UNPACK_DATA, &L,
UNPACK_VALUE, &ldl,
UNPACK_DATA, &D,
UNPACK_VALUE, &ldd,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda );
this_task, &m, &n, &k, &ib, &IPIV, &L, &ldl, &D, &ldd, &A, &lda );
CORE_zgessm(*m, *n, *k, *ib, IPIV, D, *ldd, A, *lda);
CORE_zgessm( m, n, k, ib, IPIV, D, ldd, A, lda );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgessm(const MORSE_option_t *options,
int m, int n, int k, int ib, int nb,
int *IPIV,
int m, int n, int k, int ib, int nb, int *IPIV,
const MORSE_desc_t *L, int Lm, int Ln, int ldl,
const MORSE_desc_t *D, int Dm, int Dn, int ldd,
const MORSE_desc_t *A, int Am, int An, int lda)
......@@ -127,5 +115,5 @@ void MORSE_TASK_zgessm(const MORSE_option_t *options,
sizeof(int), &ldd, VALUE,
PASSED_BY_REF, RTBLKADDR( A, MORSE_Complex64_t, Am, An ), INOUT,
sizeof(int), &lda, VALUE,
0);
PARSEC_DTD_ARG_END );
}
......@@ -28,24 +28,19 @@ static inline int
CORE_zgessq_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int m;
int n;
MORSE_Complex64_t *A;
int *lda;
int lda;
double *SCALESUMSQ;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_DATA, &SCALESUMSQ );
this_task, &m, &n, &A, &lda, &SCALESUMSQ );
CORE_zgessq( *m, *n, A, *lda, SCALESUMSQ, SCALESUMSQ+1);
CORE_zgessq( m, n, A, lda, SCALESUMSQ, SCALESUMSQ+1 );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgessq( const MORSE_option_t *options,
......@@ -59,8 +54,8 @@ void MORSE_TASK_zgessq( const MORSE_option_t *options,
PARSEC_dtd_taskpool, CORE_zgessq_parsec, options->priority, "gessq",
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
PASSED_BY_REF, RTBLKADDR( A, MORSE_Complex64_t, Am, An ), INPUT,
PASSED_BY_REF, RTBLKADDR( A, MORSE_Complex64_t, Am, An ), INPUT,
sizeof(int), &lda, VALUE,
PASSED_BY_REF, RTBLKADDR( SCALESUMSQ, double, SCALESUMSQm, SCALESUMSQn ), INOUT,
0);
PARSEC_DTD_ARG_END );
}
......@@ -28,29 +28,22 @@ static inline int
CORE_zgetrf_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int m;
int n;
MORSE_Complex64_t *A;
int *lda;
int lda;
int *IPIV;
MORSE_bool *check_info;
int *iinfo;
int iinfo;
int info;
parsec_dtd_unpack_args(
this_task,
UNPACK_VALUE, &m,
UNPACK_VALUE, &n,
UNPACK_DATA, &A,
UNPACK_VALUE, &lda,
UNPACK_SCRATCH, &IPIV,
UNPACK_VALUE, &check_info,
UNPACK_VALUE, &iinfo );
this_task, &m, &n, &A, &lda, &IPIV, &check_info, &iinfo );
CORE_zgetrf( *m, *n, A, *lda, IPIV, &info );
CORE_zgetrf( m, n, A, lda, IPIV, &info );
(void)context;
return 0;
return PARSEC_HOOK_RETURN_DONE;
}
void MORSE_TASK_zgetrf(const MORSE_option_t *options,
......@@ -70,5 +63,5 @@ void MORSE_TASK_zgetrf(const MORSE_option_t *options,
sizeof(int)*nb, IPIV, SCRATCH,
sizeof(MORSE_bool), &check_info, VALUE,
sizeof(int), &iinfo, VALUE,
0);
PARSEC_DTD_ARG_END );
}
......@@ -29,7 +29,7 @@
* @ingroup CORE_MORSE_Complex64_t
*
* CORE_zgetrf_incpiv computes an LU factorization of a general M-by-N tile A
* using partial pivoting with row interchanges.
* using partial pivoting with row int erchanges.
*
* The factorization has the form
*
......@@ -62,7 +62,7 @@
*
* @param[out] IPIV
* The pivot indices; for 1 <= i <= min(M,N), row i of the
* tile was interchanged with row IPIV(i).
* tile was int erchanged with row IPIV(i).
*
* @param[out] INFO
* See returned value.
......@@ -82,32 +82,24 @@ static inline int
CORE_zgetrf_incpiv_parsec( parsec_execution_stream_t *context,
parsec_task_t *this_task )
{
int *m;
int *n;
int *ib;