Commit 6a7a74cc authored by Mathieu Faverge's avatar Mathieu Faverge

Fix remaining min/max

parent 18ff643a
......@@ -301,7 +301,7 @@ int MORSE_Set(MORSE_enum param, int value)
morse_warning("MORSE_Set", "autotuning has been automatically disable\n");
}
/* Limit ib to nb */
morse->ib = min( morse->nb, morse->ib );
morse->ib = chameleon_min( morse->nb, morse->ib );
break;
case MORSE_INNER_BLOCK_SIZE:
if (value <= 0) {
......
......@@ -88,19 +88,6 @@
**/
#define cudablas_error(k, str) fprintf(stderr, "%s: Parameter %d / %s\n", __func__, k, str)
/*******************************************************************************
* Global utilities
**/
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef roundup
#define roundup(a, b) (b <= 0) ? (a) : (((a) + (b)-1) & ~((b)-1))
#endif
/** ****************************************************************************
* LAPACK Constants
**/
......
......@@ -149,7 +149,7 @@ static void cl_zgelqt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda, &ldt, &h_work);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_zgelqt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
#endif /* !defined(CHAMELEON_SIMULATION) */
......@@ -182,7 +182,7 @@ static void cl_zgelqt_cuda_func(void *descr[], void *cl_arg)
/* Gather pointer to scratch data on host */
h_T = h_A + ib*n;
h_TAU = h_T + ib*ib;
h_W = h_TAU + max(m,n);
h_W = h_TAU + chameleon_max(m,n);
h_D = h_W + ib*ib;
stream = starpu_cuda_get_local_stream();
......
......@@ -150,7 +150,7 @@ static void cl_zgeqrt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda, &ldt, &h_work);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_zgeqrt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
......@@ -182,7 +182,7 @@ static void cl_zgeqrt_cuda_func(void *descr[], void *cl_arg)
/* Gather pointer to scratch data on host */
h_T = h_A + m*ib;
h_TAU = h_T + ib*ib;
h_W = h_TAU + max(m,n);
h_W = h_TAU + chameleon_max(m,n);
h_D = h_W + ib*ib;
stream = starpu_cuda_get_local_stream();
......
......@@ -162,7 +162,7 @@ static void cl_zgetrf_incpiv_cpu_func(void *descr[], void *cl_arg)
L += ib;
for (i=0; i<n; i+=ib) {
sb = min( ib, n-i );
sb = chameleon_min( ib, n-i );
CORE_zlacpy(MorseUpperLower, sb, sb, A+(i*lda+i), lda, L+(i*ldl), ldl );
CORE_ztrtri( MorseLower, MorseUnit, sb, L+(i*ldl), ldl, &info );
......
......@@ -170,7 +170,7 @@ static void cl_ztslqt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda1, &lda2, &ldt, &h_work);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_ztslqt(m, n, ib, A1, lda1, A2, lda2, T, ldt, TAU, WORK);
}
......@@ -200,7 +200,7 @@ static void cl_ztslqt_cuda_func(void *descr[], void *cl_arg)
h_A2 = (cuDoubleComplex*)RUNTIME_starpu_ws_getlocal(h_work);
h_T = h_A2 + ib*n;
h_TAU = h_T + ib*n;
h_W = h_TAU + max(m,n);
h_W = h_TAU + chameleon_max(m,n);
h_D = h_W + ib*m;
stream = starpu_cuda_get_local_stream();
......
......@@ -160,7 +160,7 @@ static void cl_ztsqrt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda1, &lda2, &ldt, &h_work);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_ztsqrt(m, n, ib, A1, lda1, A2, lda2, T, ldt, TAU, WORK);
}
......@@ -190,7 +190,7 @@ static void cl_ztsqrt_cuda_func(void *descr[], void *cl_arg)
h_A2 = (cuDoubleComplex*)RUNTIME_starpu_ws_getlocal(h_work);
h_T = h_A2 + m*ib;
h_TAU = h_T + ib*ib;
h_W = h_TAU + max(m,n);
h_W = h_TAU + chameleon_max(m,n);
h_D = h_W + ib*n;
stream = starpu_cuda_get_local_stream();
......
......@@ -187,7 +187,7 @@ static void cl_ztstrf_cpu_func(void *descr[], void *cl_arg)
{
int i, sb;
for (i=0; i<n; i+=ib) {
sb = min( ib, n-i );
sb = chameleon_min( ib, n-i );
CORE_zlacpy(MorseUpperLower, sb, sb, L+(i*ldl), ldl, L+(i*ldl)+ib, ldl );
CORE_ztrtri( MorseLower, MorseUnit, sb, L+(i*ldl)+ib, ldl, &info );
......
......@@ -166,7 +166,7 @@ static void cl_zttlqt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda1, &lda2, &ldt);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_zttlqt(m, n, ib, A1, lda1, A2, lda2, T, ldt, TAU, WORK);
}
......
......@@ -166,7 +166,7 @@ static void cl_zttqrt_cpu_func(void *descr[], void *cl_arg)
starpu_codelet_unpack_args(cl_arg, &m, &n, &ib, &lda1, &lda2, &ldt);
WORK = TAU + max( m, n );
WORK = TAU + chameleon_max( m, n );
CORE_zttqrt(m, n, ib, A1, lda1, A2, lda2, T, ldt, TAU, WORK);
}
......
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