MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
zplghe.c File Reference
#include "common.h"
Include dependency graph for zplghe.c:

Go to the source code of this file.

Functions

int MAGMA_zplghe (double bump, int N, PLASMA_Complex64_t *A, int LDA, unsigned long long int seed)
int MAGMA_zplghe_Tile (double bump, magma_desc_t *A, unsigned long long int seed)
int MAGMA_zplghe_Tile_Async (double bump, magma_desc_t *A, unsigned long long int seed, magma_sequence_t *sequence, magma_request_t *request)

Detailed Description

MAGMA compute MAGMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver, and INRIA Bordeaux Sud-Ouest

Version:
2.3.1
Author:
Mathieu Faverge
Date:
2011-06-01 normal z -> c

Definition in file zplghe.c.


Function Documentation

int MAGMA_zplghe ( double  bump,
int  N,
PLASMA_Complex64_t *  A,
int  LDA,
unsigned long long int  seed 
)

MAGMA_zplghe - Generate a random hermitian matrix by tiles.

Parameters:
[in]bumpThe value to add to the diagonal to be sure to have a positive definite matrix.
[in]NThe order of the matrix A. N >= 0.
[out]AOn exit, The random hermitian matrix A generated.
[in]LDAThe leading dimension of the array A. LDA >= max(1,M).
[in]seedThe seed used in the random generation.
Returns:
Return values:
MAGMA_SUCCESSsuccessful exit
<0if -i, the i-th argument had an illegal value
See also:
MAGMA_zplghe_Tile
MAGMA_zplghe_Tile_Async
MAGMA_cplghe
MAGMA_dplghe
MAGMA_splghe
MAGMA_zplrnt
MAGMA_zplgsy

Definition at line 59 of file zplghe.c.

References magma_context_self(), magma_desc_mat_free(), MAGMA_ERR_NOT_INITIALIZED, magma_error, magma_fatal_error, MAGMA_NB, MAGMA_REQUEST_INITIALIZER, magma_sequence_create(), magma_sequence_destroy(), MAGMA_SUCCESS, magma_zdesc_alloc, magma_zooptile2lap, MAGMA_zplghe_Tile_Async(), max, morse_barrier(), and magma_sequence_s::status.

{
int NB;
int status;
magma_sequence_t *sequence = NULL;
magma_desc_t descA;
magma = magma_context_self();
if (magma == NULL) {
magma_fatal_error("MAGMA_zplghe", "MAGMA not initialized");
}
/* Check input arguments */
if (N < 0) {
magma_error("MAGMA_zplghe", "illegal value of N");
return -2;
}
if (LDA < max(1, N)) {
magma_error("MAGMA_zplghe", "illegal value of LDA");
return -4;
}
/* Quick return */
if (max(0, N) == 0)
return MAGMA_SUCCESS;
/* Tune NB depending on M, N && NRHS; Set NBNB */
/* status = magma_tune(MAGMA_FUNC_ZGEMM, N, N, 0); */
/* if (status != MAGMA_SUCCESS) { */
/* magma_error("MAGMA_zplghe", "magma_tune() failed"); */
/* return status; */
/* } */
/* Set NT */
NB = MAGMA_NB;
magma_sequence_create(magma, &sequence);
magma_zdesc_alloc( descA, NB, NB, LDA, N, 0, 0, N, N, magma_desc_mat_free(&(descA)) );
/* Call the tile interface */
MAGMA_zplghe_Tile_Async( bump, &descA, seed, sequence, &request );
morse_barrier( magma );
magma_zooptile2lap( descA, A, NB, NB, LDA, N );
morse_barrier( magma );
status = sequence->status;
magma_sequence_destroy(magma, sequence);
return status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int MAGMA_zplghe_Tile ( double  bump,
magma_desc_t A,
unsigned long long int  seed 
)

MAGMA_zplghe_Tile - Generate a random hermitian matrix by tiles. Tile equivalent of MAGMA_zplghe(). Operates on matrices stored by tiles. All matrices are passed through descriptors. All dimensions are taken from the descriptors.

Parameters:
[in]bumpThe value to add to the diagonal to be sure to have a positive definite matrix.
[in]AOn exit, The random hermitian matrix A generated.
[in]seedThe seed used in the random generation.
Returns:
Return values:
MAGMA_SUCCESSsuccessful exit
See also:
MAGMA_zplghe
MAGMA_zplghe_Tile_Async
MAGMA_cplghe_Tile
MAGMA_dplghe_Tile
MAGMA_splghe_Tile
MAGMA_zplrnt_Tile
MAGMA_zplgsy_Tile

Definition at line 152 of file zplghe.c.

References magma_context_self(), MAGMA_ERR_NOT_INITIALIZED, magma_fatal_error, MAGMA_REQUEST_INITIALIZER, magma_sequence_create(), magma_sequence_destroy(), MAGMA_zplghe_Tile_Async(), morse_barrier(), morse_desc_getoncpu, and magma_sequence_s::status.

{
magma_sequence_t *sequence = NULL;
int status;
magma = magma_context_self();
if (magma == NULL) {
magma_fatal_error("MAGMA_zplghe_Tile", "MAGMA not initialized");
}
magma_sequence_create(magma, &sequence);
MAGMA_zplghe_Tile_Async( bump, A, seed, sequence, &request );
morse_barrier( magma );
status = sequence->status;
magma_sequence_destroy(magma, sequence);
return status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int MAGMA_zplghe_Tile_Async ( double  bump,
magma_desc_t A,
unsigned long long int  seed,
magma_sequence_t sequence,
magma_request_t request 
)

MAGMA_zplghe_Tile_Async - Generate a random hermitian matrix by tiles. Non-blocking equivalent of MAGMA_zplghe_Tile(). May return before the computation is finished. Allows for pipelining of operations ar runtime.

Parameters:
[in]sequenceIdentifies the sequence of function calls that this call belongs to (for completion checks and exception handling purposes).
[out]requestIdentifies this function call (for exception handling purposes).
See also:
MAGMA_zplghe
MAGMA_zplghe_Tile
MAGMA_cplghe_Tile_Async
MAGMA_dplghe_Tile_Async
MAGMA_splghe_Tile_Async
MAGMA_zplghe_Tile_Async
MAGMA_zplgsy_Tile_Async

Definition at line 203 of file zplghe.c.

References magma_desc_s::desc, magma_context_self(), magma_desc_check(), MAGMA_ERR_ILLEGAL_VALUE, MAGMA_ERR_NOT_INITIALIZED, MAGMA_ERR_SEQUENCE_FLUSHED, MAGMA_ERR_UNALLOCATED, magma_error, magma_fatal_error, magma_pzplghe(), magma_request_fail(), MAGMA_SUCCESS, min, magma_request_s::status, and magma_sequence_s::status.

{
PLASMA_desc descA = A->desc;
magma = magma_context_self();
if (magma == NULL) {
magma_fatal_error("MAGMA_zplghe_Tile", "MAGMA not initialized");
}
if (sequence == NULL) {
magma_fatal_error("MAGMA_zplghe_Tile", "NULL sequence");
}
if (request == NULL) {
magma_fatal_error("MAGMA_zplghe_Tile", "NULL request");
}
/* Check sequence status */
if (sequence->status == MAGMA_SUCCESS)
request->status = MAGMA_SUCCESS;
else
return magma_request_fail(sequence, request, MAGMA_ERR_SEQUENCE_FLUSHED);
/* Check descriptors for correctness */
magma_error("MAGMA_zplghe_Tile", "invalid descriptor");
return magma_request_fail(sequence, request, MAGMA_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if (descA.nb != descA.mb) {
magma_error("MAGMA_zplghe_Tile", "only square tiles supported");
return magma_request_fail(sequence, request, MAGMA_ERR_ILLEGAL_VALUE);
}
/* Quick return */
if (min( descA.m, descA.n ) == 0)
return MAGMA_SUCCESS;
magma_pzplghe( bump, A, seed, sequence, request);
return MAGMA_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function: