codelet_zher2k.c 3.29 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_zher2k.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
 *
 **/
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 27 28 29 30 31

/***************************************************************************//**
 *
 * @ingroup CORE_MORSE_Complex64_t
 *
 **/
Mathieu Faverge's avatar
Mathieu Faverge committed
32 33 34
static inline int
CORE_zher2k_parsec( parsec_execution_stream_t *context,
                    parsec_task_t             *this_task )
Mathieu Faverge's avatar
Mathieu Faverge committed
35 36 37 38 39 40
{
    MORSE_enum *uplo;
    MORSE_enum *trans;
    int *n;
    int *k;
    MORSE_Complex64_t *alpha;
Mathieu Faverge's avatar
Mathieu Faverge committed
41
    MORSE_Complex64_t *A;
Mathieu Faverge's avatar
Mathieu Faverge committed
42
    int *lda;
Mathieu Faverge's avatar
Mathieu Faverge committed
43
    MORSE_Complex64_t *B;
Mathieu Faverge's avatar
Mathieu Faverge committed
44 45
    int *ldb;
    double *beta;
Mathieu Faverge's avatar
Mathieu Faverge committed
46
    MORSE_Complex64_t *C;
Mathieu Faverge's avatar
Mathieu Faverge committed
47 48
    int *ldc;

Mathieu Faverge's avatar
Mathieu Faverge committed
49
    parsec_dtd_unpack_args(
50 51 52 53 54 55 56 57 58 59 60 61 62
        this_task,
        UNPACK_VALUE, &uplo,
        UNPACK_VALUE, &trans,
        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 );
Mathieu Faverge's avatar
Mathieu Faverge committed
63 64 65 66 67 68

    CORE_zher2k(*uplo, *trans, *n, *k,
                *alpha, A, *lda,
                        B, *ldb,
                *beta,  C, *ldc);

Mathieu Faverge's avatar
Mathieu Faverge committed
69
    (void)context;
Mathieu Faverge's avatar
Mathieu Faverge committed
70 71 72
    return 0;
}

73
void MORSE_TASK_zher2k(const MORSE_option_t *options,
Mathieu Faverge's avatar
Mathieu Faverge committed
74 75
                       MORSE_enum uplo, MORSE_enum trans,
                       int n, int k, int nb,
76 77 78
                       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,
                       double beta, const MORSE_desc_t *C, int Cm, int Cn, int ldc)
Mathieu Faverge's avatar
Mathieu Faverge committed
79
{
Mathieu Faverge's avatar
Mathieu Faverge committed
80
    parsec_taskpool_t* PARSEC_dtd_taskpool = (parsec_taskpool_t *)(options->sequence->schedopt);
Mathieu Faverge's avatar
Mathieu Faverge committed
81

Mathieu Faverge's avatar
Mathieu Faverge committed
82 83
    parsec_dtd_taskpool_insert_task(
        PARSEC_dtd_taskpool, CORE_zher2k_parsec, options->priority, "her2k",
84 85 86 87 88
        sizeof(MORSE_enum),                 &uplo,     VALUE,
        sizeof(MORSE_enum),                 &trans,    VALUE,
        sizeof(int),                        &n,        VALUE,
        sizeof(int),                        &k,        VALUE,
        sizeof(MORSE_Complex64_t),          &alpha,    VALUE,
89
        PASSED_BY_REF,         RTBLKADDR( A, MORSE_Complex64_t, Am, An ),     INPUT | morse_parsec_get_arena_index(A),
90
        sizeof(int),                        &lda,      VALUE,
91
        PASSED_BY_REF,         RTBLKADDR( B, MORSE_Complex64_t, Bm, Bn ),     INPUT | morse_parsec_get_arena_index(B),
92 93
        sizeof(int),                        &ldb,      VALUE,
        sizeof(double),                     &beta,     VALUE,
94
        PASSED_BY_REF,         RTBLKADDR( C, MORSE_Complex64_t, Cm, Cn ),     INOUT | morse_parsec_get_arena_index(C) | AFFINITY,
95 96
        sizeof(int),                        &ldc,      VALUE,
        0);
97 98

    (void)nb;
Mathieu Faverge's avatar
Mathieu Faverge committed
99
}