codelet_zasum.c 2.51 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 23 24 25 26 27 28 29 30 31
 *
 **/

/**
 * @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
 *
 **/
#include "runtime/parsec/include/morse_parsec.h"

static int
CORE_dzasum_parsec(dague_execution_unit_t *context, dague_execution_context_t *this_task)
{
    MORSE_enum *storev;
    MORSE_enum *uplo;
    int *M;
    int *N;
Mathieu Faverge's avatar
Mathieu Faverge committed
32
    MORSE_Complex64_t *A;
Mathieu Faverge's avatar
Mathieu Faverge committed
33
    int *lda;
Mathieu Faverge's avatar
Mathieu Faverge committed
34
    double *work;
Mathieu Faverge's avatar
Mathieu Faverge committed
35 36 37 38 39 40

    dague_dtd_unpack_args(this_task,
                          UNPACK_VALUE, &storev,
                          UNPACK_VALUE, &uplo,
                          UNPACK_VALUE, &M,
                          UNPACK_VALUE, &N,
Mathieu Faverge's avatar
Mathieu Faverge committed
41
                          UNPACK_DATA,  &A,
Mathieu Faverge's avatar
Mathieu Faverge committed
42
                          UNPACK_VALUE, &lda,
Mathieu Faverge's avatar
Mathieu Faverge committed
43
                          UNPACK_DATA,  &work
Mathieu Faverge's avatar
Mathieu Faverge committed
44 45 46 47 48 49 50
                        );

    CORE_dzasum(*storev, *uplo, *M, *N, A, *lda, work);

    return 0;
}

51
void MORSE_TASK_dzasum(const MORSE_option_t *options,
Mathieu Faverge's avatar
Mathieu Faverge committed
52
                       MORSE_enum storev, MORSE_enum uplo, int M, int N,
53 54
                       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
55 56 57 58 59 60 61 62 63 64
{
    dague_dtd_handle_t* DAGUE_dtd_handle = (dague_dtd_handle_t *)(options->sequence->schedopt);

    insert_task_generic_fptr(DAGUE_dtd_handle,      CORE_dzasum_parsec,               "zasum",
                             sizeof(MORSE_enum),    &storev,                           VALUE,
                             sizeof(MORSE_enum),    &uplo,                             VALUE,
                             sizeof(int),           &M,                                VALUE,
                             sizeof(int),           &N,                                VALUE,
                             PASSED_BY_REF,         RTBLKADDR( A, MORSE_Complex64_t, Am, An ),     INPUT | REGION_FULL,
                             sizeof(int),           &lda,                              VALUE,
Mathieu Faverge's avatar
Mathieu Faverge committed
65
                             PASSED_BY_REF,         RTBLKADDR( B, double, Bm, Bn ),     INOUT | REGION_FULL,
Mathieu Faverge's avatar
Mathieu Faverge committed
66 67
                             0);
}