Commit 4b52f1eb authored by Mathieu Faverge's avatar Mathieu Faverge

Apply the max/min change to other runtimes and timings

parent 6a7a74cc
......@@ -143,7 +143,7 @@ int morse_alloc_ipiv(int M, int N, MORSE_enum func, int type, MORSE_desc_t **des
lm = IB * MT;
ln = NB * NT;
size = (size_t)(min(MT, NT) * NB * NT * sizeof(int));
size = (size_t)(chameleon_min(MT, NT) * NB * NT * sizeof(int));
if (size <= 0) {
*IPIV = NULL;
return MORSE_SUCCESS;
......
......@@ -55,7 +55,7 @@ void MORSE_TASK_zlange(const MORSE_option_t *options,
{
dague_dtd_handle_t* DAGUE_dtd_handle = (dague_dtd_handle_t *)(options->sequence->schedopt);
int szeW = max( M, N );
int szeW = chameleon_max( M, N );
dague_insert_task(
DAGUE_dtd_handle, CORE_zlange_parsec, "lange",
......
......@@ -55,7 +55,7 @@ void MORSE_TASK_zlanhe(const MORSE_option_t *options,
{
dague_dtd_handle_t* DAGUE_dtd_handle = (dague_dtd_handle_t *)(options->sequence->schedopt);
int szeW = max( 1, N );
int szeW = chameleon_max( 1, N );
dague_insert_task(
DAGUE_dtd_handle, CORE_zlanhe_parsec, "LANHE",
......
......@@ -55,7 +55,7 @@ void MORSE_TASK_zlansy(const MORSE_option_t *options,
{
dague_dtd_handle_t* DAGUE_dtd_handle = (dague_dtd_handle_t *)(options->sequence->schedopt);
int szeW = max( 1, N );
int szeW = chameleon_max( 1, N );
dague_insert_task(
DAGUE_dtd_handle, CORE_zlansy_parsec, "lansy",
......
......@@ -58,7 +58,7 @@ void MORSE_TASK_zlantr(const MORSE_option_t *options,
{
dague_dtd_handle_t* DAGUE_dtd_handle = (dague_dtd_handle_t *)(options->sequence->schedopt);
int szeW = max( 1, N );
int szeW = chameleon_max( 1, N );
dague_insert_task(
DAGUE_dtd_handle, CORE_zlantr_parsec, "lantr",
......
......@@ -36,8 +36,9 @@ void MORSE_TASK_zlange(const MORSE_option_t *options,
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_LANGE;
int szeW = max( M, N );
QUARK_Insert_Task(opt->quark, CORE_zlange_quark, (Quark_Task_Flags*)opt,
int szeW = chameleon_max( M, N );
QUARK_Insert_Task(
opt->quark, CORE_zlange_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &norm, VALUE,
sizeof(int), &M, VALUE,
sizeof(int), &N, VALUE,
......@@ -69,7 +70,8 @@ void MORSE_TASK_zlange_max(const MORSE_option_t *options,
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_LANGE_MAX;
QUARK_Insert_Task(opt->quark, CORE_zlange_max_quark, (Quark_Task_Flags*)opt,
QUARK_Insert_Task(
opt->quark, CORE_zlange_max_quark, (Quark_Task_Flags*)opt,
sizeof(double), RTBLKADDR(A, double, Am, An), INPUT,
sizeof(double), RTBLKADDR(B, double, Bm, Bn), OUTPUT,
0);
......
......@@ -36,8 +36,9 @@ void MORSE_TASK_zlanhe(const MORSE_option_t *options,
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_LANHE;
int szeW = max( 1, N );
QUARK_Insert_Task(opt->quark, CORE_zlanhe_quark, (Quark_Task_Flags*)opt,
int szeW = chameleon_max( 1, N );
QUARK_Insert_Task(
opt->quark, CORE_zlanhe_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &norm, VALUE,
sizeof(MORSE_enum), &uplo, VALUE,
sizeof(int), &N, VALUE,
......
......@@ -36,8 +36,9 @@ void MORSE_TASK_zlansy(const MORSE_option_t *options,
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_LANSY;
int szeW = max( 1, N );
QUARK_Insert_Task(opt->quark, CORE_zlansy_quark, (Quark_Task_Flags*)opt,
int szeW = chameleon_max( 1, N );
QUARK_Insert_Task(
opt->quark, CORE_zlansy_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &norm, VALUE,
sizeof(MORSE_enum), &uplo, VALUE,
sizeof(int), &N, VALUE,
......
......@@ -34,8 +34,9 @@ void MORSE_TASK_zlantr(const MORSE_option_t *options,
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_LANTR;
int szeW = max( 1, N );
QUARK_Insert_Task(opt->quark, CORE_zlantr_quark, (Quark_Task_Flags*)opt,
int szeW = chameleon_max( 1, N );
QUARK_Insert_Task(
opt->quark, CORE_zlantr_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &norm, VALUE,
sizeof(MORSE_enum), &uplo, VALUE,
sizeof(MORSE_enum), &diag, VALUE,
......
......@@ -31,8 +31,8 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_Complex64_t alpha, beta;
PASTE_CODE_IPARAM_LOCALS( iparam );
LDB = max(K, iparam[IPARAM_LDB]);
LDC = max(M, iparam[IPARAM_LDC]);
LDB = chameleon_max(K, iparam[IPARAM_LDB]);
LDC = chameleon_max(M, iparam[IPARAM_LDC]);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, K );
......
......@@ -32,8 +32,8 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
LDB = max(K, iparam[IPARAM_LDB]);
LDC = max(M, iparam[IPARAM_LDC]);
LDB = chameleon_max(K, iparam[IPARAM_LDB]);
LDC = chameleon_max(M, iparam[IPARAM_LDC]);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, M, K );
......
......@@ -44,7 +44,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_zplrnt(M, N, A, LDA, 3456);
/* Allocate Workspace */
MORSE_Alloc_Workspace_zgesv_incpiv( min(M,N), &L, &piv, P, Q);
MORSE_Alloc_Workspace_zgesv_incpiv( chameleon_min(M,N), &L, &piv, P, Q);
/* Save AT in lapack layout for check */
PASTE_CODE_ALLOCATE_COPY( Acpy, check, MORSE_Complex64_t, A, LDA, N );
......
......@@ -52,7 +52,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_zplrnt_Tile(descA, 3456);
/* Allocate Workspace */
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(min(M,N), &descL, &piv, P, Q);
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(chameleon_min(M,N), &descL, &piv, P, Q);
/* Save A for check */
if (check == 1){
......
......@@ -53,7 +53,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_zplrnt_Tile(descA, 3456);
/* Allocate Workspace */
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(min(M,N), &descL, &piv, P, Q);
MORSE_Alloc_Workspace_zgesv_incpiv_Tile(chameleon_min(M,N), &descL, &piv, P, Q);
/* Save A for check */
if (check == 1){
......
......@@ -34,7 +34,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
int vec = MorseVec;
int INFO;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N);
......
......@@ -45,7 +45,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
/* Check the solution */
if ( check )
{
double *work = (double*) malloc(max(M,N)*sizeof(double));
double *work = (double*) malloc(chameleon_max(M,N)*sizeof(double));
normlapack = LAPACKE_zlange_work(LAPACK_COL_MAJOR, morse_lapack_const(norm), M, N, A, LDA, work);
result = fabs(normmorse - normlapack);
switch(norm) {
......
......@@ -47,7 +47,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
{
/* Allocate Data */
PASTE_TILE_TO_LAPACK( descA, A, check, MORSE_Complex64_t, M, N );
double *work = (double*) malloc(max(M,N)*sizeof(double));
double *work = (double*) malloc(chameleon_max(M,N)*sizeof(double));
normlapack = LAPACKE_zlange_work(LAPACK_COL_MAJOR, morse_lapack_const(norm), M, N, A, LDA, work);
result = fabs(normmorse - normlapack);
switch(norm) {
......
......@@ -31,7 +31,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
MORSE_enum uplo = MorseUpper;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
......
......@@ -30,7 +30,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
MORSE_enum uplo = MorseUpper;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N );
......
......@@ -31,7 +31,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
int uplo = MorseLower;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
......
......@@ -30,7 +30,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
int uplo = MorseUpper;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N );
......
......@@ -32,7 +32,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
MORSE_enum uplo = MorseLower;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N );
......
......@@ -30,7 +30,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
int uplo = MorseUpper;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
check = 1;
/* Allocate Data */
......
......@@ -30,7 +30,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
PASTE_CODE_IPARAM_LOCALS( iparam );
int uplo = MorseUpper;
LDA = max(LDA, N);
LDA = chameleon_max(LDA, N);
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N );
......
......@@ -31,7 +31,7 @@ RunTest(int *iparam, double *dparam, morse_time_t *t_)
MORSE_Complex64_t alpha;
PASTE_CODE_IPARAM_LOCALS( iparam );
LDA = max( LDA, N );
LDA = chameleon_max( LDA, N );
/* Allocate Data */
PASTE_CODE_ALLOCATE_MATRIX( A, 1, MORSE_Complex64_t, LDA, N );
......
......@@ -700,9 +700,9 @@ main(int argc, char *argv[]) {
{
if ( nx > 0 ) {
iparam[IPARAM_M] = i;
iparam[IPARAM_N] = max(1, i/nx);
iparam[IPARAM_N] = chameleon_max(1, i/nx);
} else if ( mx > 0 ) {
iparam[IPARAM_M] = max(1, i/mx);
iparam[IPARAM_M] = chameleon_max(1, i/mx);
iparam[IPARAM_N] = i;
} else {
if ( m == -1 )
......
......@@ -86,9 +86,9 @@ enum dparam_timing {
int64_t N = iparam[IPARAM_N]; \
int64_t K = iparam[IPARAM_K]; \
int64_t NRHS = K; \
int64_t LDA = max(M, iparam[IPARAM_LDA]); \
int64_t LDB = max(N, iparam[IPARAM_LDB]); \
int64_t LDC = max(K, iparam[IPARAM_LDC]); \
int64_t LDA = chameleon_max(M, iparam[IPARAM_LDA]); \
int64_t LDB = chameleon_max(N, iparam[IPARAM_LDB]); \
int64_t LDC = chameleon_max(K, iparam[IPARAM_LDC]); \
int64_t IB = iparam[IPARAM_IB]; \
int64_t MB = iparam[IPARAM_MB]; \
int64_t NB = iparam[IPARAM_NB]; \
......
......@@ -33,7 +33,7 @@ int z_check_orthogonality(int M, int N, int LDQ, MORSE_Complex64_t *Q)
double normQ;
int info_ortho;
int i;
int minMN = min(M, N);
int minMN = chameleon_min(M, N);
double eps;
double *work = (double *)malloc(minMN*sizeof(double));
......@@ -89,7 +89,7 @@ int z_check_QRfactorization(int M, int N, MORSE_Complex64_t *A1, MORSE_Complex64
MORSE_Complex64_t *Ql = (MORSE_Complex64_t *)malloc(M*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *Residual = (MORSE_Complex64_t *)malloc(M*N*sizeof(MORSE_Complex64_t));
double *work = (double *)malloc(max(M,N)*sizeof(double));
double *work = (double *)malloc(chameleon_max(M,N)*sizeof(double));
alpha=1.0;
beta=0.0;
......@@ -226,7 +226,7 @@ double z_check_gemm(MORSE_enum transA, MORSE_enum transB, int M, int N, int K,
{
MORSE_Complex64_t beta_const = -1.0;
double Rnorm;
double *work = (double *)malloc(max(K,max(M, N))* sizeof(double));
double *work = (double *)malloc(chameleon_max(K,chameleon_max(M, N))* sizeof(double));
*Cinitnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', M, N, Cref, LDC, work);
*Cmorsenorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', M, N, Cmorse, LDC, work);
......@@ -256,7 +256,7 @@ double z_check_trsm(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_en
{
MORSE_Complex64_t beta_const = -1.0;
double Rnorm;
double *work = (double *)malloc(max(M, NRHS)* sizeof(double));
double *work = (double *)malloc(chameleon_max(M, NRHS)* sizeof(double));
/*double eps = LAPACKE_dlamch_work('e');*/
*Binitnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'i', M, NRHS, Bref, LDB, work);
......@@ -272,7 +272,7 @@ double z_check_trsm(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_en
Rnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'i', M, NRHS, Bref, LDB, work);
Rnorm = Rnorm / *Blapacknorm;
/* max(M,NRHS) * eps);*/
/* chameleon_max(M,NRHS) * eps);*/
free(work);
......@@ -291,7 +291,7 @@ double z_check_solution(int M, int N, int NRHS, MORSE_Complex64_t *A, int LDA,
double Rnorm = -1.00;
MORSE_Complex64_t zone = 1.0;
MORSE_Complex64_t mzone = -1.0;
double *work = (double *)malloc(max(M, N)* sizeof(double));
double *work = (double *)malloc(chameleon_max(M, N)* sizeof(double));
*anorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', M, N, A, LDA, work);
*xnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', M, NRHS, X, LDB, 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