codelet_zgessq.c 2.38 KB
Newer Older
1 2
/**
 *
3 4
 * @copyright (c) 2009-2014 The University of Tennessee and The University
 *                          of Tennessee Research Foundation.
5
 *                          All rights reserved.
6
 * @copyright (c) 2012-2016 Inria. All rights reserved.
7
 * @copyright (c) 2012-2014, 2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 **/

/**
 *
 * @file codelet_zgessq.c
 *
 *  MORSE codelets kernel
 *  MORSE is a software package provided by Inria Bordeaux - Sud-Ouest, LaBRI,
 *  University of Bordeaux, Bordeaux INP
 *
 * @version 2.6.0
 * @comment This file has been automatically generated
 *          from Plasma 2.6.0 for MORSE 1.0.0
 * @author Mathieu Faverge
 * @date 2010-11-15
 * @precisions normal z -> c d s
 *
 **/
27
#include "runtime/starpu/include/morse_starpu.h"
28
#include "runtime/starpu/include/runtime_codelet_z.h"
29

30
void MORSE_TASK_zgessq( const MORSE_option_t *options,
31
                        int m, int n,
32 33
                        const MORSE_desc_t *A, int Am, int An, int lda,
                        const MORSE_desc_t *SCALESUMSQ, int SCALESUMSQm, int SCALESUMSQn )
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
{
    struct starpu_codelet *codelet = &cl_zgessq;
    void (*callback)(void*) = options->profiling ? cl_zgessq_callback : NULL;
    if ( morse_desc_islocal( A, Am, An ) ||
         morse_desc_islocal( SCALESUMSQ, SCALESUMSQm, SCALESUMSQn ) ){
        starpu_insert_task(codelet,
            STARPU_VALUE,    &m,                          sizeof(int),
            STARPU_VALUE,    &n,                          sizeof(int),
            STARPU_R,        RTBLKADDR(A, MORSE_Complex64_t, Am, An),
            STARPU_VALUE,    &lda,                        sizeof(int),
            STARPU_RW,       RTBLKADDR(SCALESUMSQ, double, SCALESUMSQm, SCALESUMSQn),
            STARPU_PRIORITY, options->priority,
            STARPU_CALLBACK, callback,
            0);
    }
}


52
#if !defined(CHAMELEON_SIMULATION)
53 54 55 56 57 58 59 60 61 62 63 64 65
static void cl_zgessq_cpu_func(void *descr[], void *cl_arg)
{
    int m;
    int n;
    MORSE_Complex64_t *A;
    int lda;
    double *SCALESUMSQ;

    A          = (MORSE_Complex64_t *)STARPU_MATRIX_GET_PTR(descr[0]);
    SCALESUMSQ = (double *)STARPU_MATRIX_GET_PTR(descr[1]);
    starpu_codelet_unpack_args(cl_arg, &m, &n, &lda);
    CORE_zgessq( m, n, A, lda, &SCALESUMSQ[0], &SCALESUMSQ[1] );
}
66 67
#endif //!defined(CHAMELEON_SIMULATION)

68 69 70 71
/*
 * Codelet definition
 */
CODELETS_CPU(zgessq, 2, cl_zgessq_cpu_func)