Commit 9e668381 authored by Mathieu Faverge's avatar Mathieu Faverge

Cleanup warnings, especially by using a static inline function instead of a macro for min/max

parent a8954d6f
......@@ -83,7 +83,7 @@ void morse_pzgelqf(MORSE_desc_t *A, MORSE_desc_t *T,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -92,15 +92,15 @@ void morse_pzgelqf(MORSE_desc_t *A, MORSE_desc_t *T,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, ib * (ib + A->nb) );
ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
/* Host space
*
* zgelqt = ib * A->nb + 3 * ib * ib + A->nb
* ztslqt = 3 * ib * A->nb + ib * ib + A->nb
*/
ws_host = max( ws_host, ib * A->nb + 3 * ib * ib + A->nb );
ws_host = max( ws_host, 3 * ib * A->nb + ib * ib + A->nb );
ws_host = chameleon_max( ws_host, ib * A->nb + 3 * ib * ib + A->nb );
ws_host = chameleon_max( ws_host, 3 * ib * A->nb + ib * ib + A->nb );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -111,7 +111,7 @@ void morse_pzgelqf(MORSE_desc_t *A, MORSE_desc_t *T,
#if defined(CHAMELEON_COPY_DIAG)
/* necessary to avoid dependencies between tslqt and unmlq tasks regarding the diag tile */
DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, chameleon_min(A->m, A->n), A->nb, 0, 0, chameleon_min(A->m, A->n), A->nb, A->p, A->q);
#endif
for (k = 0; k < minMNT; k++) {
......
......@@ -84,7 +84,7 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -93,15 +93,15 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, ib * (ib + A->nb) );
ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
/* Host space
*
* zgelqt = ib * A->nb + 3 * ib * ib + A->nb
* ztslqt = 3 * ib * A->nb + ib * ib + A->nb
*/
ws_host = max( ws_host, ib * A->nb + 3 * ib * ib + A->nb );
ws_host = max( ws_host, 3 * ib * A->nb + ib * ib + A->nb );
ws_host = chameleon_max( ws_host, ib * A->nb + 3 * ib * ib + A->nb );
ws_host = chameleon_max( ws_host, 3 * ib * A->nb + ib * ib + A->nb );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -118,12 +118,12 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
}
#endif
for (k = 0; k < min(A->mt, A->nt); k++) {
for (k = 0; k < chameleon_min(A->mt, A->nt); k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
ldak = BLKLDD(A, k);
for (N = k; N < A->nt; N += BS) {
tempNn = N == A->nt-1 ? A->n-N*A->nb : A->nb;
tempkmin = min(tempkm, tempNn);
tempkmin = chameleon_min(tempkm, tempNn);
MORSE_TASK_zgelqt(
&options,
tempkm, tempNn, ib, T->nb,
......@@ -156,7 +156,7 @@ void morse_pzgelqfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
T(k, N), T->mb,
A(m, N), ldam);
}
for (n = N+1; n < min(N+BS, A->nt); n++) {
for (n = N+1; n < chameleon_min(N+BS, A->nt); n++) {
tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
MORSE_TASK_ztslqt(
&options,
......
......@@ -54,7 +54,7 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
int ldak, ldam;
int tempkm, tempkn, tempnn, tempmm;
int ib;
int minMNT = min(A->mt, A->nt);
int minMNT = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......@@ -78,7 +78,7 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -87,15 +87,15 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, 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
*/
ws_host = max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = max( ws_host, 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 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -106,7 +106,7 @@ void morse_pzgeqrf(MORSE_desc_t *A, MORSE_desc_t *T,
#if defined(CHAMELEON_COPY_DIAG)
/* necessary to avoid dependencies between tsqrt and unmqr tasks regarding the diag tile */
DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, chameleon_min(A->m, A->n), A->nb, 0, 0, chameleon_min(A->m, A->n), A->nb, A->p, A->q);
#endif
for (k = 0; k < minMNT; k++) {
......
......@@ -82,7 +82,7 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -91,15 +91,15 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, ib * (ib + A->nb) );
ws_worker = chameleon_max( ws_worker, ib * (ib + A->nb) );
/* Host space
*
* zgeqrt = ib * (A->nb+3*ib) + A->nb )
* ztsqrt = 2 * ib * (A->nb+ib) + A->nb
*/
ws_host = max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = max( ws_host, 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 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -116,12 +116,12 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
}
#endif
K = min(A->mt, A->nt);
K = chameleon_min(A->mt, A->nt);
for (k = 0; k < K; k++) {
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
for (M = k; M < A->mt; M += BS) {
tempMm = M == A->mt-1 ? A->m-M*A->mb : A->mb;
tempkmin = min(tempMm, tempkn);
tempkmin = chameleon_min(tempMm, tempkn);
ldaM = BLKLDD(A, M);
MORSE_TASK_zgeqrt(
&options,
......@@ -154,7 +154,7 @@ void morse_pzgeqrfrh(MORSE_desc_t *A, MORSE_desc_t *T, int BS,
T(M, k), T->mb,
A(M, n), ldaM);
}
for (m = M+1; m < min(M+BS, A->mt); m++) {
for (m = M+1; m < chameleon_min(M+BS, A->mt); m++) {
tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
ldam = BLKLDD(A, m);
MORSE_TASK_ztsqrt(
......
......@@ -56,7 +56,7 @@ void morse_pzgetrf_incpiv(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
int ldak, ldam;
int tempkm, tempkn, tempmm, tempnn;
int ib;
int minMNT = min(A->mt, A->nt);
int minMNT = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......@@ -75,7 +75,7 @@ void morse_pzgetrf_incpiv(MORSE_desc_t *A, MORSE_desc_t *L, int *IPIV,
/* necessary to avoid dependencies between tasks regarding the diag tile */
DIAG = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
morse_zdesc_alloc_diag(*DIAG, A->mb, A->nb, chameleon_min(A->m, A->n), A->nb, 0, 0, chameleon_min(A->m, A->n), A->nb, A->p, A->q);
for (k = 0; k < minMNT; k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
......
......@@ -53,7 +53,7 @@ void morse_pzgetrf_nopiv(MORSE_desc_t *A,
ib = MORSE_IB;
for (k = 0; k < min(A->mt, A->nt); k++) {
for (k = 0; k < chameleon_min(A->mt, A->nt); k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
ldak = BLKLDD(A, k);
......
......@@ -82,7 +82,7 @@ void morse_pzhetrd_he2hb(MORSE_enum uplo,
* ztsmqr = 2 * A->nb * ib
* zherfb = A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -91,15 +91,15 @@ void morse_pzhetrd_he2hb(MORSE_enum uplo,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, 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
*/
ws_host = max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = max( ws_host, 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 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -110,17 +110,17 @@ void morse_pzhetrd_he2hb(MORSE_enum uplo,
#if defined(CHAMELEON_COPY_DIAG)
/* Copy of the extra-diagonal to generate more parallelism by releasing anti-dependencies on UNMQR/TSMQR triangle conflict */
E = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*E, A->mb, A->nb, min(A->m, A->n), A->nb, 0, 0, min(A->m, A->n), A->nb, A->p, A->q);
morse_zdesc_alloc_diag(*E, A->mb, A->nb, chameleon_min(A->m, A->n), A->nb, 0, 0, chameleon_min(A->m, A->n), A->nb, A->p, A->q);
#endif
/* Copy of the diagonal tiles to keep the general version of the tile all along the computation */
D = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
morse_zdesc_alloc_diag(*D, A->mb, A->nb, min(A->m, A->n) - A->mb, A->nb, 0, 0, min(A->m, A->n) - A->mb, A->nb, A->p, A->q);
morse_zdesc_alloc_diag(*D, A->mb, A->nb, chameleon_min(A->m, A->n) - A->mb, A->nb, 0, 0, chameleon_min(A->m, A->n) - A->mb, A->nb, A->p, A->q);
AT = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
*AT = morse_desc_init(
MorseComplexDouble, A->mb, A->nb, (A->mb*A->nb),
min(A->mt, A->nt) * A->mb, A->nb, 0, 0, min(A->mt, A->nt) * A->mb, A->nb, 1, 1);
chameleon_min(A->mt, A->nt) * A->mb, A->nb, 0, 0, chameleon_min(A->mt, A->nt) * A->mb, A->nb, 1, 1);
morse_desc_mat_alloc( AT );
/* Let's extract the diagonal in a temporary copy that contains A and A' */
......
......@@ -98,7 +98,7 @@ void morse_pzlacpy(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
A(m, m), ldam,
B(m, m), ldbm);
}
for (n = 0; n < min(m, A->nt); n++) {
for (n = 0; n < chameleon_min(m, A->nt); n++) {
Y = n == A->nt-1 ? A->n-n*A->nb : A->nb;
MORSE_TASK_zlacpy(
&options,
......
......@@ -70,7 +70,7 @@ void morse_pzlange(MORSE_enum norm, MORSE_desc_t *A, double *result,
/* Init workspace handle for the call to zlange but unused */
RUNTIME_options_ws_alloc( &options, 1, 0 );
workm = max( A->mt, A->p );
workm = chameleon_max( A->mt, A->p );
workn = A->n;
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, 1, A->nb, A->nb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......@@ -169,7 +169,7 @@ void morse_pzlange(MORSE_enum norm, MORSE_desc_t *A, double *result,
RUNTIME_options_ws_alloc( &options, A->mb, 0 );
workm = A->m;
workn = max( A->nt, A->q );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, A->mb, 1, A->mb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......@@ -283,8 +283,8 @@ void morse_pzlange(MORSE_enum norm, MORSE_desc_t *A, double *result,
*/
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);
......@@ -353,8 +353,8 @@ void morse_pzlange(MORSE_enum norm, MORSE_desc_t *A, double *result,
/* 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);
......
......@@ -76,7 +76,7 @@ void morse_pzlanhe(MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A, double *re
RUNTIME_options_ws_alloc( &options, A->mb, 0 );
workm = A->m;
workn = max( A->nt, A->q );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, A->mb, 1, A->mb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......@@ -212,8 +212,8 @@ void morse_pzlanhe(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);
......@@ -352,8 +352,8 @@ void morse_pzlanhe(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);
......
......@@ -76,7 +76,7 @@ void morse_pzlansy(MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A, double *re
RUNTIME_options_ws_alloc( &options, A->mb, 0 );
workm = A->m;
workn = max( A->nt, A->q );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, A->mb, 1, A->mb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......
......@@ -51,7 +51,7 @@ void morse_pzlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
int m, n, minMNT;
/* int part_p, part_q; */
minMNT = min( A->mt, A->nt );
minMNT = chameleon_min( A->mt, A->nt );
/* part_p = A->myrank / A->q; */
/* part_q = A->myrank % A->q; */
......@@ -70,7 +70,7 @@ void morse_pzlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
/* Init workspace handle for the call to zlange but unused */
RUNTIME_options_ws_alloc( &options, 1, 0 );
workm = max( A->mt, A->p );
workm = chameleon_max( A->mt, A->p );
workn = A->n;
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, 1, A->nb, A->nb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......@@ -239,7 +239,7 @@ void morse_pzlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
RUNTIME_options_ws_alloc( &options, A->mb, 0 );
workm = A->m;
workn = max( A->nt, A->q );
workn = chameleon_max( A->nt, A->q );
MORSE_Desc_Create(&(VECNORMS_STEP1), NULL, MorseRealDouble, A->mb, 1, A->mb,
workm, workn, 0, 0, workm, workn, A->p, A->q);
......@@ -404,8 +404,8 @@ void morse_pzlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
* 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);
......@@ -548,8 +548,8 @@ void morse_pzlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
/* 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);
......
......@@ -27,7 +27,7 @@ void morse_pzlascal(MORSE_enum uplo, MORSE_Complex64_t alpha, MORSE_desc_t *A,
int tempmm, tempnn, tempmn, tempnm;
int m, n;
int ldam, ldan;
int minmnt = min(A->mt, A->nt);
int minmnt = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......
......@@ -46,7 +46,7 @@ void morse_pzlaset(MORSE_enum uplo,
int ldai, ldaj;
int tempim;
int tempjm, tempjn;
int minmn = min(A->mt, A->nt);
int minmn = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......@@ -77,7 +77,7 @@ void morse_pzlaset(MORSE_enum uplo,
else if (uplo == MorseUpper) {
for (j = 1; j < A->nt; j++){
tempjn = j == A->nt-1 ? A->n-j*A->nb : A->nb;
for (i = 0; i < min(j, A->mt); i++){
for (i = 0; i < chameleon_min(j, A->mt); i++){
tempim = i == A->mt-1 ? A->m-i*A->mb : A->mb;
ldai = BLKLDD(A, i);
MORSE_TASK_zlaset(
......
......@@ -45,7 +45,7 @@ void morse_pzlaset2(MORSE_enum uplo, MORSE_Complex64_t alpha,
int ldai, ldaj;
int tempim;
int tempjm, tempjn;
int minmn = min(A->mt, A->nt);
int minmn = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......@@ -76,7 +76,7 @@ void morse_pzlaset2(MORSE_enum uplo, MORSE_Complex64_t alpha,
else if (uplo == MorseUpper) {
for (j = 1; j < A->nt; j++){
tempjn = j == A->nt-1 ? A->n-j*A->nb : A->nb;
for (i = 0; i < min(j, A->mt); i++){
for (i = 0; i < chameleon_min(j, A->mt); i++){
tempim = i == A->mt-1 ? A->m-i*A->mb : A->mb;
ldai = BLKLDD(A, i);
MORSE_TASK_zlaset2(
......
......@@ -42,7 +42,7 @@ void morse_pztile2band(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
int j;
int ldaj, ldx;
int tempjm, tempjn;
int minmnt = min(A->mt, A->nt);
int minmnt = chameleon_min(A->mt, A->nt);
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
......@@ -56,7 +56,7 @@ void morse_pztile2band(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
*/
if ( uplo == MorseLower ) {
for (j = 0; j < minmnt; j++){
/* Compute dimension on N with B since it is dimensioned with min(A->m, A->n) */
/* Compute dimension on N with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->m == B->n );
assert( A->n >= B->n );
......@@ -89,7 +89,7 @@ void morse_pztile2band(MORSE_enum uplo, MORSE_desc_t *A, MORSE_desc_t *B,
}
else if ( uplo == MorseUpper ) {
for (j = 0; j < minmnt; j++){
/* Compute dimension on M with B since it is dimensioned with min(A->m, A->n) */
/* Compute dimension on M with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->n == B->n );
assert( A->m >= B->n );
tempjn = j == A->nt-1 ? A->n - j * A->nb : A->nb;
......
......@@ -68,7 +68,7 @@ void morse_pztpgqrt( int L, MORSE_desc_t *V, MORSE_desc_t *T, MORSE_desc_t *A, M
*
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -80,7 +80,7 @@ void morse_pztpgqrt( int L, MORSE_desc_t *V, MORSE_desc_t *T, MORSE_desc_t *A, M
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
ldak = BLKLDD(A, k);
maxmtk = min( B->mt, maxmt+k ) - 1;
maxmtk = chameleon_min( B->mt, maxmt+k ) - 1;
for (m = maxmtk; m > -1; m--) {
tempmm = m == B->mt-1 ? B->m-m*B->mb : B->mb;
templm = m == maxmtk ? tempmm : 0;
......
......@@ -70,7 +70,7 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
#if defined(CHAMELEON_USE_MAGMA)
......@@ -79,15 +79,15 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
* zgeqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
* ztsqrt = max( A->nb * (ib+1), ib * (ib + A->nb) )
*/
ws_worker = max( ws_worker, 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
*/
ws_host = max( ws_host, ib * (A->mb + 3 * ib) + A->mb );
ws_host = max( ws_host, 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 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -124,7 +124,7 @@ void morse_pztpqrt( int L, MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *T,
}
}
maxmt = min( B->mt, maxmt+1 );
maxmt = chameleon_min( B->mt, maxmt+1 );
}
RUNTIME_options_ws_free(&options);
RUNTIME_options_finalize(&options, morse);
......
......@@ -53,7 +53,7 @@ void morse_pztradd(MORSE_enum uplo, MORSE_enum trans,
switch(uplo){
case MorseLower:
if (trans == MorseNoTrans) {
for (n = 0; n < min(B->mt,B->nt); n++) {
for (n = 0; n < chameleon_min(B->mt,B->nt); n++) {
tempnm = n == B->mt-1 ? B->m-n*B->mb : B->mb;
tempnn = n == B->nt-1 ? B->n-n*B->nb : B->nb;
ldan = BLKLDD(A, n);
......@@ -79,7 +79,7 @@ void morse_pztradd(MORSE_enum uplo, MORSE_enum trans,
}
}
else {
for (n = 0; n < min(B->mt,B->nt); n++) {
for (n = 0; n < chameleon_min(B->mt,B->nt); n++) {
tempnm = n == B->mt-1 ? B->m-n*B->mb : B->mb;
tempnn = n == B->nt-1 ? B->n-n*B->nb : B->nb;
ldan = BLKLDD(A, n);
......@@ -106,7 +106,7 @@ void morse_pztradd(MORSE_enum uplo, MORSE_enum trans,
break;
case MorseUpper:
if (trans == MorseNoTrans) {
for (m = 0; m < min(B->mt,B->nt); m++) {
for (m = 0; m < chameleon_min(B->mt,B->nt); m++) {
tempmm = m == B->mt-1 ? B->m-B->mb*m : B->nb;
tempmn = m == B->nt-1 ? B->n-m*B->nb : B->nb;
ldam = BLKLDD(A, m);
......@@ -130,7 +130,7 @@ void morse_pztradd(MORSE_enum uplo, MORSE_enum trans,
}
}
else {
for (m = 0; m < min(B->mt,B->nt); m++) {
for (m = 0; m < chameleon_min(B->mt,B->nt); m++) {
tempmm = m == B->mt-1 ? B->m-B->mb*m : B->nb;
tempmn = m == B->nt-1 ? B->n-m*B->nb : B->nb;
ldam = BLKLDD(A, m);
......
......@@ -54,10 +54,10 @@ void morse_pztrsmpl(MORSE_desc_t *A, MORSE_desc_t *B, MORSE_desc_t *L, int *IPIV
RUNTIME_options_init(&options, morse, sequence, request);
ib = MORSE_IB;
for (k = 0; k < min(A->mt, A->nt); k++) {
for (k = 0; k < chameleon_min(A->mt, A->nt); k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
tempkmin = k == min(A->mt, A->nt)-1 ? min(A->m, A->n)-k*A->mb : A->mb;
tempkmin = k == chameleon_min(A->mt, A->nt)-1 ? chameleon_min(A->m, A->n)-k*A->mb : A->mb;
ldak = BLKLDD(A, k);
ldbk = BLKLDD(B, k);
for (n = 0; n < B->nt; n++) {
......
......@@ -83,7 +83,7 @@ void morse_pzunglq(MORSE_desc_t *A, MORSE_desc_t *Q, MORSE_desc_t *T,
* zunmlq = A->nb * ib
* ztsmlq = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif
ws_worker *= sizeof(MORSE_Complex64_t);
......@@ -100,7 +100,7 @@ void morse_pzunglq(MORSE_desc_t *A, MORSE_desc_t *Q, MORSE_desc_t *T,
for (k = minMT-1; k >= 0; k--) {
tempAkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
tempAkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
tempkmin = min( tempAkn, tempAkm );
tempkmin = chameleon_min( tempAkn, tempAkm );
tempkn = k == Q->nt-1 ? Q->n-k*Q->nb : Q->nb;
ldak = BLKLDD(A, k);
for (n = Q->nt-1; n > k; n--) {
......
......@@ -80,7 +80,7 @@ void morse_pzunglqrh(MORSE_desc_t *A, MORSE_desc_t *Q,
* zunmqr = A->nb * ib
* ztsmqr = 2 * A->nb * ib
*/
ws_worker = max( ws_worker, ib * A->nb * 2 );
ws_worker = chameleon_max( ws_worker, ib * A->nb * 2 );
#endif