Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libiconmath
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libiconmath
Commits
d5f6519d
Commit
d5f6519d
authored
3 months ago
by
Pradipta Samanta
Browse files
Options
Downloads
Patches
Plain Diff
added the test for the cpp binding of tdma_solver_vec
fixed a bug in testing
parent
f6ac8211
No related branches found
No related tags found
1 merge request
!37
Draft: C++ port of horizontal/mo_lib_gradients.F90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/support/CMakeLists.txt
+1
-1
1 addition, 1 deletion
src/support/CMakeLists.txt
test/fortran/test_math_utilities.f90
+25
-4
25 additions, 4 deletions
test/fortran/test_math_utilities.f90
with
26 additions
and
5 deletions
src/support/CMakeLists.txt
+
1
−
1
View file @
d5f6519d
...
@@ -43,7 +43,7 @@ if(IM_ENABLE_DIM_SWAP)
...
@@ -43,7 +43,7 @@ if(IM_ENABLE_DIM_SWAP)
endif
()
endif
()
if
(
IM_USE_CPP_BINDINGS
)
if
(
IM_USE_CPP_BINDINGS
)
target_compile_definitions
(
iconmath-support P
RIVATE
__USE_CPP_BINDINGS
)
target_compile_definitions
(
iconmath-support P
UBLIC
__USE_CPP_BINDINGS
)
endif
()
endif
()
if
(
IM_ENABLE_OPENACC
)
if
(
IM_ENABLE_OPENACC
)
...
...
This diff is collapsed.
Click to expand it.
test/fortran/test_math_utilities.f90
+
25
−
4
View file @
d5f6519d
...
@@ -248,7 +248,9 @@ CONTAINS
...
@@ -248,7 +248,9 @@ CONTAINS
INTEGER
,
PARAMETER
::
n
=
10
INTEGER
,
PARAMETER
::
n
=
10
REAL
(
wp
)
::
a
(
n
,
n
),
b
(
n
,
n
),
c
(
n
,
n
),
d
(
n
,
n
),
x
(
n
,
n
)
REAL
(
wp
)
::
a
(
n
,
n
),
b
(
n
,
n
),
c
(
n
,
n
),
d
(
n
,
n
),
x
(
n
,
n
)
INTEGER
::
i
,
j
INTEGER
::
i
,
j
REAL
(
wp
)
::
sum
,
sum_ref
REAL
(
wp
)
::
sum
,
sum_ref
,
tol
REAL
(
wp
)
::
start_time
,
end_time
,
elapsed_time
DO
i
=
1
,
n
DO
i
=
1
,
n
DO
j
=
1
,
n
DO
j
=
1
,
n
a
(
i
,
j
)
=
1.0_wp
a
(
i
,
j
)
=
1.0_wp
...
@@ -257,14 +259,33 @@ CONTAINS
...
@@ -257,14 +259,33 @@ CONTAINS
d
(
i
,
j
)
=
1.0_wp
d
(
i
,
j
)
=
1.0_wp
END
DO
END
DO
END
DO
END
DO
CALL
CPU_TIME
(
start_time
)
#ifndef __USE_CPP_BINDINGS
CALL
tdma_solver_vec
(
a
,
b
,
c
,
d
,
1
,
n
,
1
,
n
,
x
)
CALL
tdma_solver_vec
(
a
,
b
,
c
,
d
,
1
,
n
,
1
,
n
,
x
)
#else
CALL
tdma_solver_vec
(
a
,
b
,
c
,
d
,
0
,
n
,
0
,
n
,
x
,
-1
)
#endif
CALL
CPU_TIME
(
end_time
)
! Compute elapsed time
elapsed_time
=
end_time
-
start_time
! Output timing result
write
(
*
,
*
)
"Elapsed time for tdma_solver_vec: "
,
elapsed_time
,
" seconds"
sum
=
0.0_wp
sum
=
0.0_wp
DO
i
=
1
,
n
DO
i
=
1
,
n
sum
=
sum
+
x
(
i
,
1
)
DO
j
=
1
,
n
sum
=
sum
+
x
(
i
,
j
)
! write(*,"(a,f24.16)") ' x(i, 1): ', x(i, 1)
END
DO
END
DO
END
DO
sum_ref
=
4.5454545454545467_wp
sum_ref
=
27.2727272727272769_wp
tol
=
1d-15
CALL
TAG_TEST
(
"TEST_tdma_solver_vec"
)
CALL
TAG_TEST
(
"TEST_tdma_solver_vec"
)
CALL
ASSERT_EQUAL
(
sum
,
sum_ref
)
CALL
ASSERT_ALMOST_EQUAL
(
sum
,
sum_ref
,
tol
)
END
SUBROUTINE
TEST_tdma_solver_vec
END
SUBROUTINE
TEST_tdma_solver_vec
END
MODULE
TEST_mo_math_utilities
END
MODULE
TEST_mo_math_utilities
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