Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fortran addition test #737

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/Fortran-tests/add_matrix_typed.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function test_add_matrix_typed(matrix_type, element_kind, element_precision,&
DUMMY_KIND(DUMMY_PREC), allocatable :: c_dense(:, :)
DUMMY_KIND(DUMMY_PREC), allocatable :: d_dense(:, :)

real(DUMMY_PREC) :: expected, rel_diff, tol
real(DUMMY_PREC) :: expected, diff, tol

integer :: i, j

Expand Down Expand Up @@ -69,9 +69,9 @@ function test_add_matrix_typed(matrix_type, element_kind, element_precision,&
do i = 1, n
do j = 1, n
expected = alpha * a_dense(i, j) + beta * c_dense(i, j)
rel_diff = abs((expected - b_dense(i, j)) / expected)
if(rel_diff > tol) then
print *, "rel. diff = ", rel_diff
diff = abs((expected - b_dense(i, j)))
if(diff > tol) then
print *, "diff = ", diff
call bml_error(__FILE__, __LINE__, &
& "add() matrices are not identical")
end if
Expand All @@ -81,9 +81,9 @@ function test_add_matrix_typed(matrix_type, element_kind, element_precision,&
else
expected = a_dense(i, j)
end if
rel_diff = abs((expected - d_dense(i, j)) / expected)
if(rel_diff > tol) then
print *, "rel. diff = ", rel_diff
diff = abs((expected - d_dense(i, j)))
if(diff > tol) then
print *, "rel. diff = ", diff
call bml_error(__FILE__, __LINE__, &
& "add_identity() matrices are not identical")
end if
Expand Down