codelet_zasum.c 2.18 KB
Newer Older
Mathieu Faverge's avatar
Mathieu Faverge committed
1 2 3 4 5 6
/**
 *
 * @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.
7
 * @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
Mathieu Faverge's avatar
Mathieu Faverge committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 **/

/**
 * @file codelet_zasum.c
 *
 *  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
 *
 **/
23 24
#include "chameleon_parsec.h"
#include "chameleon/morse_tasks_z.h"
25
#include "coreblas/coreblas_z.h"
Mathieu Faverge's avatar
Mathieu Faverge committed
26

Mathieu Faverge's avatar
Mathieu Faverge committed
27 28 29
static inline int
CORE_dzasum_parsec( parsec_execution_stream_t *context,
                    parsec_task_t             *this_task )
Mathieu Faverge's avatar
Mathieu Faverge committed
30
{
31 32 33 34
    MORSE_enum storev;
    MORSE_enum uplo;
    int M;
    int N;
Mathieu Faverge's avatar
Mathieu Faverge committed
35
    MORSE_Complex64_t *A;
36
    int lda;
Mathieu Faverge's avatar
Mathieu Faverge committed
37
    double *work;
Mathieu Faverge's avatar
Mathieu Faverge committed
38

Mathieu Faverge's avatar
Mathieu Faverge committed
39
    parsec_dtd_unpack_args(
40
        this_task, &storev, &uplo, &M, &N, &A, &lda, &work );
Mathieu Faverge's avatar
Mathieu Faverge committed
41

42
    CORE_dzasum( storev, uplo, M, N, A, lda, work );
Mathieu Faverge's avatar
Mathieu Faverge committed
43

Mathieu Faverge's avatar
Mathieu Faverge committed
44
    (void)context;
45
    return PARSEC_HOOK_RETURN_DONE;
Mathieu Faverge's avatar
Mathieu Faverge committed
46 47
}

48
void MORSE_TASK_dzasum(const MORSE_option_t *options,
Mathieu Faverge's avatar
Mathieu Faverge committed
49
                       MORSE_enum storev, MORSE_enum uplo, int M, int N,
50 51
                       const MORSE_desc_t *A, int Am, int An, int lda,
                       const MORSE_desc_t *B, int Bm, int Bn)
Mathieu Faverge's avatar
Mathieu Faverge committed
52
{
Mathieu Faverge's avatar
Mathieu Faverge committed
53
    parsec_taskpool_t* PARSEC_dtd_taskpool = (parsec_taskpool_t *)(options->sequence->schedopt);
Mathieu Faverge's avatar
Mathieu Faverge committed
54

Mathieu Faverge's avatar
Mathieu Faverge committed
55 56
    parsec_dtd_taskpool_insert_task(
        PARSEC_dtd_taskpool, CORE_dzasum_parsec, options->priority, "zasum",
57 58 59 60
        sizeof(MORSE_enum),    &storev,                           VALUE,
        sizeof(MORSE_enum),    &uplo,                             VALUE,
        sizeof(int),           &M,                                VALUE,
        sizeof(int),           &N,                                VALUE,
61
        PASSED_BY_REF,         RTBLKADDR( A, MORSE_Complex64_t, Am, An ),     INPUT,
62
        sizeof(int),           &lda,                              VALUE,
63
        PASSED_BY_REF,         RTBLKADDR( B, double, Bm, Bn ),     INOUT,
64
        PARSEC_DTD_ARG_END );
Mathieu Faverge's avatar
Mathieu Faverge committed
65
}