Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chameleon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
Chameleon
Commits
8916d5db
"README.org" did not exist on "0df52460c4360d499609bb10659e6fe620d41931"
Commit
8916d5db
authored
3 years ago
by
LISITO Alycia
Committed by
Mathieu Faverge
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
testing: add check api std for norm
parent
d3320d9a
No related branches found
No related tags found
1 merge request
!278
Add standard api check for the norm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testing/testing_zcheck.c
+70
-61
70 additions, 61 deletions
testing/testing_zcheck.c
testing/testing_zcheck.h
+7
-2
7 additions, 2 deletions
testing/testing_zcheck.h
with
77 additions
and
63 deletions
testing/testing_zcheck.c
+
70
−
61
View file @
8916d5db
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
*
*
* @file testing_zcheck.c
* @file testing_zcheck.c
*
*
* @copyright 2019-202
1
Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-202
2
Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
* Univ. Bordeaux. All rights reserved.
*
*
***
***
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
* @author Florent Pruvost
* @author Florent Pruvost
* @author Mathieu Faverge
* @author Mathieu Faverge
* @author Nathalie Furmento
* @author Nathalie Furmento
* @date 2020-12-01
* @author Alycia Lisito
* @date 2022-02-08
* @precisions normal z -> c d s
* @precisions normal z -> c d s
*
*
*/
*/
...
@@ -168,14 +169,75 @@ int check_zmatrices( run_arg_list_t *args, cham_uplo_t uplo, CHAM_desc_t *descA,
...
@@ -168,14 +169,75 @@ int check_zmatrices( run_arg_list_t *args, cham_uplo_t uplo, CHAM_desc_t *descA,
*
*
*******************************************************************************
*******************************************************************************
*/
*/
int
check_znorm_std
(
cham_mtxtype_t
matrix_type
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
int
M
,
int
N
,
CHAMELEON_Complex64_t
*
A
,
int
LDA
)
{
int
info_solution
=
0
;
double
*
work
=
(
double
*
)
malloc
(
chameleon_max
(
M
,
N
)
*
sizeof
(
double
));
double
norm_lapack
;
double
result
;
double
eps
=
LAPACKE_dlamch_work
(
'e'
);
/* Computes the norm with the LAPACK function */
switch
(
matrix_type
)
{
case
ChamGeneral
:
norm_lapack
=
LAPACKE_zlange_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
M
,
N
,
A
,
LDA
,
work
);
break
;
#if defined(PRECISION_z) || defined(PRECISION_c)
case
ChamHermitian
:
norm_lapack
=
LAPACKE_zlanhe_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
M
,
A
,
LDA
,
work
);
break
;
#endif
case
ChamSymmetric
:
norm_lapack
=
LAPACKE_zlansy_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
M
,
A
,
LDA
,
work
);
break
;
case
ChamTriangular
:
norm_lapack
=
LAPACKE_zlantr_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
chameleon_lapack_const
(
diag
),
M
,
N
,
A
,
LDA
,
work
);
break
;
default:
fprintf
(
stderr
,
"check_znorm: mtxtype(%d) unsupported
\n
"
,
matrix_type
);
free
(
work
);
return
1
;
}
/* Compares the norms */
result
=
fabs
(
norm_cham
-
norm_lapack
)
/
(
norm_lapack
*
eps
);
switch
(
norm_type
)
{
case
ChamInfNorm
:
/* Sum order on the line can differ */
result
=
result
/
(
double
)
N
;
break
;
case
ChamOneNorm
:
/* Sum order on the column can differ */
result
=
result
/
(
double
)
M
;
break
;
case
ChamFrobeniusNorm
:
/* Sum order on every element can differ */
result
=
result
/
((
double
)
M
*
(
double
)
N
);
break
;
case
ChamMaxNorm
:
default:
/* result should be perfectly equal */
;
}
info_solution
=
(
result
<
1
)
?
0
:
1
;
free
(
work
);
return
info_solution
;
}
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
matrix_type
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
matrix_type
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
)
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
)
{
{
int
info_solution
=
0
;
int
info_solution
=
0
;
int
M
=
descA
->
m
;
int
M
=
descA
->
m
;
int
N
=
descA
->
n
;
int
N
=
descA
->
n
;
int
LDA
=
descA
->
m
;
int
LDA
=
descA
->
m
;
int
rank
=
CHAMELEON_Comm_rank
();
int
rank
=
CHAMELEON_Comm_rank
();
CHAMELEON_Complex64_t
*
A
=
NULL
;
CHAMELEON_Complex64_t
*
A
=
NULL
;
if
(
rank
==
0
)
{
if
(
rank
==
0
)
{
...
@@ -184,61 +246,8 @@ int check_znorm( run_arg_list_t *args, cham_mtxtype_t matrix_type, cham_normtype
...
@@ -184,61 +246,8 @@ int check_znorm( run_arg_list_t *args, cham_mtxtype_t matrix_type, cham_normtype
/* Converts the matrix to LAPACK layout in order to use the LAPACK norm function */
/* Converts the matrix to LAPACK layout in order to use the LAPACK norm function */
CHAMELEON_zDesc2Lap
(
uplo
,
descA
,
A
,
LDA
);
CHAMELEON_zDesc2Lap
(
uplo
,
descA
,
A
,
LDA
);
if
(
rank
==
0
)
{
if
(
rank
==
0
)
{
double
*
work
=
(
double
*
)
malloc
(
chameleon_max
(
M
,
N
)
*
sizeof
(
double
));
info_solution
=
check_znorm_std
(
matrix_type
,
norm_type
,
uplo
,
diag
,
norm_cham
,
M
,
N
,
A
,
LDA
);
double
norm_lapack
;
double
result
;
double
eps
=
LAPACKE_dlamch_work
(
'e'
);
/* Computes the norm with the LAPACK function */
switch
(
matrix_type
)
{
case
ChamGeneral
:
norm_lapack
=
LAPACKE_zlange_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
M
,
N
,
A
,
LDA
,
work
);
break
;
#if defined(PRECISION_z) || defined(PRECISION_c)
case
ChamHermitian
:
norm_lapack
=
LAPACKE_zlanhe_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
M
,
A
,
LDA
,
work
);
break
;
#endif
case
ChamSymmetric
:
norm_lapack
=
LAPACKE_zlansy_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
M
,
A
,
LDA
,
work
);
break
;
case
ChamTriangular
:
norm_lapack
=
LAPACKE_zlantr_work
(
LAPACK_COL_MAJOR
,
chameleon_lapack_const
(
norm_type
),
chameleon_lapack_const
(
uplo
),
chameleon_lapack_const
(
diag
),
M
,
N
,
A
,
LDA
,
work
);
break
;
default:
fprintf
(
stderr
,
"check_znorm: mtxtype(%d) unsupported
\n
"
,
matrix_type
);
free
(
work
);
return
1
;
}
/* Compares the norms */
result
=
fabs
(
norm_cham
-
norm_lapack
)
/
(
norm_lapack
*
eps
);
switch
(
norm_type
)
{
case
ChamInfNorm
:
/* Sum order on the line can differ */
result
=
result
/
(
double
)
N
;
break
;
case
ChamOneNorm
:
/* Sum order on the column can differ */
result
=
result
/
(
double
)
M
;
break
;
case
ChamFrobeniusNorm
:
/* Sum order on every element can differ */
result
=
result
/
((
double
)
M
*
(
double
)
N
);
break
;
case
ChamMaxNorm
:
default:
/* result should be perfectly equal */
;
}
info_solution
=
(
result
<
1
)
?
0
:
1
;
free
(
work
);
free
(
A
);
}
}
/* Broadcasts the result from the main processus */
/* Broadcasts the result from the main processus */
...
...
This diff is collapsed.
Click to expand it.
testing/testing_zcheck.h
+
7
−
2
View file @
8916d5db
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
*
*
* @file testing_zcheck.h
* @file testing_zcheck.h
*
*
* @copyright 2019-202
1
Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-202
2
Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
* Univ. Bordeaux. All rights reserved.
*
*
***
***
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
* @author Florent Pruvost
* @author Florent Pruvost
* @author Mathieu Faverge
* @author Mathieu Faverge
* @author Nathalie Furmento
* @author Nathalie Furmento
* @date 2020-12-01
* @author Alycia Lisito
* @date 2022-02-08
* @precisions normal z -> c d s
* @precisions normal z -> c d s
*
*
*/
*/
...
@@ -36,6 +37,8 @@
...
@@ -36,6 +37,8 @@
#if defined(CHAMELEON_SIMULATION)
#if defined(CHAMELEON_SIMULATION)
static
inline
int
check_zmatrices
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
CHAM_desc_t
*
descA
,
CHAM_desc_t
*
descB
)
{
return
0
;
}
static
inline
int
check_zmatrices
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
CHAM_desc_t
*
descA
,
CHAM_desc_t
*
descB
)
{
return
0
;
}
static
inline
int
check_znorm_std
(
cham_mtxtype_t
matrix_type
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
int
M
,
int
N
,
CHAMELEON_Complex64_t
*
A
,
int
LDA
)
{
return
0
;
}
static
inline
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
mtxtype
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
static
inline
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
mtxtype
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
)
{
return
0
;
}
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
)
{
return
0
;
}
static
inline
int
check_zsum
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
cham_trans_t
trans
,
CHAMELEON_Complex64_t
alpha
,
CHAM_desc_t
*
descA
,
static
inline
int
check_zsum
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
cham_trans_t
trans
,
CHAMELEON_Complex64_t
alpha
,
CHAM_desc_t
*
descA
,
...
@@ -77,6 +80,8 @@ static inline int check_zxxpd ( run_arg_list_t *args,
...
@@ -77,6 +80,8 @@ static inline int check_zxxpd ( run_arg_list_t *args,
#else
/* !defined(CHAMELEON_SIMULATION) */
#else
/* !defined(CHAMELEON_SIMULATION) */
int
check_zmatrices
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
CHAM_desc_t
*
descA
,
CHAM_desc_t
*
descB
);
int
check_zmatrices
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
CHAM_desc_t
*
descA
,
CHAM_desc_t
*
descB
);
int
check_znorm_std
(
cham_mtxtype_t
matrix_type
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
int
M
,
int
N
,
CHAMELEON_Complex64_t
*
A
,
int
LDA
);
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
mtxtype
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
int
check_znorm
(
run_arg_list_t
*
args
,
cham_mtxtype_t
mtxtype
,
cham_normtype_t
norm_type
,
cham_uplo_t
uplo
,
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
);
cham_diag_t
diag
,
double
norm_cham
,
CHAM_desc_t
*
descA
);
int
check_zsum
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
cham_trans_t
trans
,
CHAMELEON_Complex64_t
alpha
,
CHAM_desc_t
*
descA
,
int
check_zsum
(
run_arg_list_t
*
args
,
cham_uplo_t
uplo
,
cham_trans_t
trans
,
CHAMELEON_Complex64_t
alpha
,
CHAM_desc_t
*
descA
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment