Commit 18ff643a authored by Mathieu Faverge's avatar Mathieu Faverge

Fix remaining min/max

parent 9e668381
......@@ -212,8 +212,8 @@ void morse_pzlansy(MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A, double *re
* MorseFrobeniusNorm
*/
case MorseFrobeniusNorm:
workm = max( A->mt, A->p );
workn = max( A->nt, A->q );
workm = chameleon_max( A->mt, A->p );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, 1, 2, 2,
workm, 2*workn, 0, 0, workm, 2*workn, A->p, A->q);
......@@ -361,8 +361,8 @@ void morse_pzlansy(MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A, double *re
/* Init workspace handle for the call to zlange but unused */
RUNTIME_options_ws_alloc( &options, 1, 0 );
workm = max( A->mt, A->p );
workn = max( A->nt, A->q );
workm = chameleon_max( A->mt, A->p );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, 1, 1, 1,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......
......@@ -58,7 +58,7 @@ void morse_pztpgqrt( int L, MORSE_desc_t *V, MORSE_desc_t *T, MORSE_desc_t *A, M
ib = MORSE_IB;
/*
* ztsmqr = A->nb * ib
* ztpmqrt = A->nb * ib
*/
ws_worker = A->nb * ib;
......@@ -66,7 +66,7 @@ void morse_pztpgqrt( int L, MORSE_desc_t *V, MORSE_desc_t *T, MORSE_desc_t *A, M
#if defined(CHAMELEON_USE_CUDA)
/* Worker space
*
* ztsmqr = 2 * A->nb * ib
* ztpmqrt = 2 * A->nb * ib
*/
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
......
......@@ -56,10 +56,8 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
ib = MORSE_IB;
/*
* zgeqrt = A->nb * (ib+1)
* zunmqr = A->nb * ib
* ztsqrt = A->nb * (ib+1)
* ztsmqr = A->nb * ib
* ztsqrt = A->nb * (ib+1)
* ztpmqrt = A->nb * ib
*/
ws_worker = A->nb * (ib+1);
......@@ -67,8 +65,7 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
#if defined(CHAMELEON_USE_CUDA)
/* Worker space
*
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
* ztpmqrt = 2 * A->nb * ib
*/
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
......@@ -76,15 +73,13 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
#if defined(CHAMELEON_USE_MAGMA)
/* Worker space
*
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztpqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
/* Host space
*
* zgeqrt = ib * (A->mb+3*ib) + A->mb )
* ztsqrt = 2 * ib * (A->nb+ib) + A->nb
* ztpqrt = 2 * ib * (A->nb+ib) + A->nb
*/
ws_host = chameleon_max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = chameleon_max( ws_host, 2 * ib * (A->nb + ib) + A->nb );
......
......@@ -115,7 +115,7 @@ int MORSE_zbuild( MORSE_enum uplo, int M, int N,
return -4;
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -280,7 +280,7 @@ int MORSE_zbuild_Tile_Async( MORSE_enum uplo, MORSE_desc_t *A,
}
/* Quick return */
if (min( A->m, A->n ) == 0)
if (chameleon_min( A->m, A->n ) == 0)
return MORSE_SUCCESS;
morse_pzbuild(uplo, A, user_data, user_build_callback, sequence, request);
......
......@@ -106,7 +106,7 @@ int MORSE_zgelqf(int M, int N,
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNBSIZE */
......@@ -120,7 +120,7 @@ int MORSE_zgelqf(int M, int N,
NB = MORSE_NB;
morse_sequence_create(morse, &sequence);
/* if ( MORSE_TRANSLATION == MORSE_OUTOFPLACE ) {*/
morse_zooplap2tile( descA, A, NB, NB, LDA, N, 0, 0, M, N, sequence, &request,
morse_desc_mat_free(&(descA)) );
......@@ -200,7 +200,7 @@ int MORSE_zgelqf_Tile(MORSE_desc_t *A, MORSE_desc_t *T)
MORSE_zgelqf_Tile_Async(A, T, sequence, &request);
morse_sequence_wait(morse, sequence);
RUNTIME_desc_getoncpu(A);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
return status;
......@@ -274,7 +274,7 @@ int MORSE_zgelqf_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T,
}
/* Quick return */
/*
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
*/
if (morse->householder == MORSE_FLAT_HOUSEHOLDER) {
......
......@@ -105,7 +105,7 @@ int MORSE_zgeqrf(int M, int N,
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNBSIZE */
......@@ -273,7 +273,7 @@ int MORSE_zgeqrf_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T,
}
/* Quick return */
/*
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
*/
if (morse->householder == MORSE_FLAT_HOUSEHOLDER) {
......
......@@ -120,7 +120,7 @@ int MORSE_zgesv_incpiv(int N, int NRHS,
return -8;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNB */
......@@ -306,7 +306,7 @@ int MORSE_zgesv_incpiv_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV, M
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
......
......@@ -119,7 +119,7 @@ int MORSE_zgesv_nopiv(int N, int NRHS,
return -8;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNB */
......@@ -294,7 +294,7 @@ int MORSE_zgesv_nopiv_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *B,
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
......
......@@ -107,7 +107,7 @@ int MORSE_zgetrf_incpiv(int M, int N,
return -4;
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNBSIZE */
......@@ -278,7 +278,7 @@ int MORSE_zgetrf_incpiv_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
}
/* Quick return */
/*
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
*/
......
......@@ -100,7 +100,7 @@ int MORSE_zgetrf_nopiv(int M, int N,
return -4;
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on M, N & NRHS; Set NBNBSIZE */
......
......@@ -126,7 +126,7 @@ int MORSE_zgetrs_incpiv(MORSE_enum trans, int N, int NRHS,
return -9;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on N & NRHS; Set NBNBSIZE */
......@@ -309,7 +309,7 @@ int MORSE_zgetrs_incpiv_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pztrsmpl(A, B, L, IPIV, sequence, request);
......
......@@ -120,7 +120,7 @@ int MORSE_zgetrs_nopiv(MORSE_enum trans, int N, int NRHS,
return -9;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on N & NRHS; Set NBNBSIZE */
......@@ -293,7 +293,7 @@ int MORSE_zgetrs_nopiv_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *B,
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pztrsm(MorseLeft, MorseLower, MorseNoTrans, MorseUnit, (MORSE_Complex64_t)1.0, A, B, sequence, request);
......
......@@ -44,7 +44,7 @@
* = MorseLower: Lower triangular part
*
* @param[in] M
* The number of rows of the matrix A. M >= 0.
* The number of rows of the matrix A. M >= 0.
*
* @param[in] N
* The number of columns of the matrix A. N >= 0.
......@@ -90,7 +90,7 @@ int MORSE_zlacpy(MORSE_enum uplo, int M, int N,
return MORSE_ERR_NOT_INITIALIZED;
}
/* Check input arguments */
if ( (uplo != MorseUpperLower) &&
if ( (uplo != MorseUpperLower) &&
(uplo != MorseUpper) &&
(uplo != MorseLower) ) {
morse_error("MORSE_zlacpy", "illegal value of uplo");
......@@ -114,7 +114,7 @@ int MORSE_zlacpy(MORSE_enum uplo, int M, int N,
}
/* Quick return */
if (min(N, M) == 0)
if (chameleon_min(N, M) == 0)
return (double)0.0;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -281,14 +281,14 @@ int MORSE_zlacpy_Tile_Async(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ( (uplo != MorseUpperLower) &&
if ( (uplo != MorseUpperLower) &&
(uplo != MorseUpper) &&
(uplo != MorseLower) ) {
morse_error("MORSE_zlacpy_Tile_Async", "illegal value of uplo");
return -1;
}
/* Quick return */
if (min(A->m, A->n) == 0) {
if (chameleon_min(A->m, A->n) == 0) {
return MORSE_SUCCESS;
}
......
......@@ -118,7 +118,7 @@ double MORSE_zlange(MORSE_enum norm, int M, int N,
}
/* Quick return */
if (min(N, M) == 0)
if (chameleon_min(N, M) == 0)
return (double)0.0;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -281,7 +281,7 @@ int MORSE_zlange_Tile_Async(MORSE_enum norm, MORSE_desc_t *A, double *value,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Quick return */
if (min(A->m, A->n) == 0) {
if (chameleon_min(A->m, A->n) == 0) {
*value = 0.0;
return MORSE_SUCCESS;
}
......
......@@ -138,7 +138,7 @@ double MORSE_zlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
}
/* Quick return */
if (min(N, M) == 0)
if (chameleon_min(N, M) == 0)
return (double)0.0;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -315,7 +315,7 @@ int MORSE_zlantr_Tile_Async(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
}
/* Quick return */
if (min(A->m, A->n) == 0) {
if (chameleon_min(A->m, A->n) == 0) {
*value = 0.0;
return MORSE_SUCCESS;
}
......
......@@ -111,7 +111,7 @@ int MORSE_zlaset(MORSE_enum uplo, int M, int N,
}
/* Quick return */
if (min(N, M) == 0)
if (chameleon_min(N, M) == 0)
return (double)0.0;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -275,7 +275,7 @@ int MORSE_zlaset_Tile_Async(MORSE_enum uplo,
return -1;
}
/* Quick return */
if (min(A->m, A->n) == 0) {
if (chameleon_min(A->m, A->n) == 0) {
return MORSE_SUCCESS;
}
......
......@@ -258,7 +258,7 @@ int MORSE_zplghe_Tile_Async( double bump,
}
/* Quick return */
if (min( A->m, A->n ) == 0)
if (chameleon_min( A->m, A->n ) == 0)
return MORSE_SUCCESS;
morse_pzplghe(bump, uplo, A, seed, sequence, request);
......
......@@ -260,7 +260,7 @@ int MORSE_zplgsy_Tile_Async( MORSE_Complex64_t bump,
}
/* Quick return */
if (min( A->m, A->n ) == 0)
if (chameleon_min( A->m, A->n ) == 0)
return MORSE_SUCCESS;
morse_pzplgsy(bump, uplo, A, seed, sequence, request);
......
......@@ -98,7 +98,7 @@ int MORSE_zplrnt( int M, int N,
return -4;
}
/* Quick return */
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -248,7 +248,7 @@ int MORSE_zplrnt_Tile_Async( MORSE_desc_t *A,
}
/* Quick return */
if (min( A->m, A->n ) == 0)
if (chameleon_min( A->m, A->n ) == 0)
return MORSE_SUCCESS;
morse_pzplrnt(A, seed, sequence, request);
......
......@@ -133,7 +133,7 @@ int MORSE_zposv(MORSE_enum uplo, int N, int NRHS,
}
/* Quick return - currently NOT equivalent to LAPACK's
* LAPACK does not have such check for DPOSV */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNBSIZE */
......@@ -324,7 +324,7 @@ int MORSE_zposv_Tile_Async(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
/* Quick return - currently NOT equivalent to LAPACK's
* LAPACK does not have such check for DPOSV */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pzpotrf(uplo, A, sequence, request);
......
......@@ -117,7 +117,7 @@ int MORSE_zpotrs(MORSE_enum uplo, int N, int NRHS,
return -7;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -299,7 +299,7 @@ int MORSE_zpotrs_Tile_Async(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pztrsm(MorseLeft, uplo, uplo == MorseUpper ? MorseConjTrans : MorseNoTrans, MorseNonUnit, 1.0, A, B, sequence, request);
......
......@@ -130,7 +130,7 @@ int MORSE_zsysv(MORSE_enum uplo, int N, int NRHS,
}
/* Quick return - currently NOT equivalent to LAPACK's
* LAPACK does not have such check for Dsysv */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNBSIZE */
......@@ -315,7 +315,7 @@ int MORSE_zsysv_Tile_Async(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
/* Quick return - currently NOT equivalent to LAPACK's
* LAPACK does not have such check for Dsysv */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pzsytrf(uplo, A, sequence, request);
......
......@@ -116,7 +116,7 @@ int MORSE_zsytrs(MORSE_enum uplo, int N, int NRHS,
return -7;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -292,7 +292,7 @@ int MORSE_zsytrs_Tile_Async(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pztrsm(MorseLeft, uplo, uplo == MorseUpper ? MorseTrans : MorseNoTrans, MorseNonUnit, 1.0, A, B, sequence, request);
......
......@@ -133,9 +133,9 @@ int MORSE_ztrmm(MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrmm", "illegal value of uplo");
return -2;
}
if (transA != MorseConjTrans &&
transA != MorseNoTrans &&
transA != MorseTrans )
if (transA != MorseConjTrans &&
transA != MorseNoTrans &&
transA != MorseTrans )
{
morse_error("MORSE_ztrmm", "illegal value of transA");
return -3;
......@@ -161,7 +161,7 @@ int MORSE_ztrmm(MORSE_enum side, MORSE_enum uplo,
return -10;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......@@ -288,7 +288,7 @@ int MORSE_ztrmm_Tile(MORSE_enum side, MORSE_enum uplo,
morse_sequence_wait(morse, sequence);
RUNTIME_desc_getoncpu(A);
RUNTIME_desc_getoncpu(B);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
return status;
......
......@@ -159,7 +159,7 @@ int MORSE_ztrsm(MORSE_enum side, MORSE_enum uplo,
return -10;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB depending on M, N & NRHS; Set NBNB */
......
......@@ -114,7 +114,7 @@ int MORSE_ztrsmpl(int N, int NRHS,
return -8;
}
/* Quick return */
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
/* Tune NB & IB depending on N & NRHS; Set NBNB */
......@@ -294,7 +294,7 @@ int MORSE_ztrsmpl_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV, MORSE_
}
/* Quick return */
/*
if (min(N, NRHS) == 0)
if (chameleon_min(N, NRHS) == 0)
return MORSE_SUCCESS;
*/
morse_pztrsmpl(A, B, L, IPIV, sequence, request);
......
......@@ -295,7 +295,7 @@ int MORSE_zunglq_Tile_Async(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *Q,
/* Quick return - currently NOT equivalent to LAPACK's:
* CALL DLASET( 'Full', MAX( M, N ), NRHS, ZERO, ZERO, Q, LDQ ) */
/*
if (min(M, N) == 0)
if (chameleon_min(M, N) == 0)
return MORSE_SUCCESS;
*/
morse_pzlaset(MorseUpperLower, 0., 1., Q, sequence, request);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment