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

/**
 *
 * @file pzbuild.c
 *
 *  MORSE auxiliary routines
 *  MORSE is a software package provided by Univ. of Tennessee,
 *  Univ. of California Berkeley and Univ. of Colorado Denver
 *
 * @version 2.5.0
 * @comment This file has been automatically generated
 *          from Plasma 2.5.0 for MORSE 1.0.0
 * @author Mathieu Faverge
 * @author Emmanuel Agullo
 * @author Cedric Castagnede
 * @author Guillaume Sylvand
 * @date 2016-09-05
 * @precisions normal z -> s d c
 *
 **/
#include "control/common.h"

#define A(m, n) A,  m,  n
Mathieu Faverge's avatar
Mathieu Faverge committed
33
/*******************************************************************************
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
 *  Parallel tile matrix generation
 *
 *******************************************************************************
 *
 * @param[in] uplo
 *          Specifies the part of the matrix A to be copied to B.
 *            = MorseUpperLower: All the matrix A
 *            = MorseUpper: Upper triangular part
 *            = MorseLower: Lower triangular part
 *
 * @param[in] A
 *          On exit, The matrix A generated.
 *
 * @param[in] user_data
 *          The data used in the matrix generation.
 *
 * @param[in] user_build_callback
 *          The function called by the codelet to fill the tiles
 *
 * @param[in] sequence
 *          Identifies the sequence of function calls that this call belongs to
 *          (for completion checks and exception handling purposes).
 *
 * @param[out] request
 *          Identifies this function call (for exception handling purposes).
 *
 *******************************************************************************/
void morse_pzbuild( MORSE_enum uplo, MORSE_desc_t *A, void *user_data, void* user_build_callback,
                    MORSE_sequence_t *sequence, MORSE_request_t *request )
{
  MORSE_context_t *morse;
  MORSE_option_t options;

  int m, n;
  int ldam;

  morse = morse_context_self();
  if (sequence->status != MORSE_SUCCESS)
    return;
  RUNTIME_options_init(&options, morse, sequence, request);

  for (m = 0; m < A->mt; m++) {
    ldam = BLKLDD(A, m);
    for (n = 0; n < A->nt; n++) {

79 80 81
      if ( ( uplo == MorseUpper && m <= n ) ||
           ( uplo == MorseLower && m >= n ) ||
           ( uplo == MorseUpperLower ) )
82 83 84 85 86 87 88
        MORSE_TASK_zbuild(
              &options,
              A(m, n), ldam,
              user_data, user_build_callback );
    }
  }

89
  RUNTIME_options_finalize( &options, morse);
90
}