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

Work around ifx automatic-offloading bugs #145

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions src/inference_engine/inference_engine_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,26 @@ function get_key_value(line) result(value_)
difference%nodes_difference_(l) = self%nodes_(l) - rhs%nodes_(l)

associate(n => self%nodes_)
#ifndef __INTEL_COMPILER
do concurrent(l = 1:ubound(n,1))
difference%weights_difference_(1:n(l),1:n(l-1),l) = self%weights_(1:n(l),1:n(l-1),l) - rhs%weights_(1:n(l),1:n(l-1),l)
difference%biases_difference_(1:n(l),l) = self%biases_(1:n(l),l) - rhs%biases_(1:n(l),l)
difference%nodes_difference_(l) = self%nodes_(l) - rhs%nodes_(l)
end do
#else
block
integer j, k
do l = 1, ubound(n,1)
do j = 1, n(l)
do k = 1, n(l-1)
difference%weights_difference_(j,k,l) = self%weights_(j,k,l) - rhs%weights_(j,k,l)
difference%biases_difference_(j,l) = self%biases_(j,l) - rhs%biases_(j,l)
difference%nodes_difference_(l) = self%nodes_(l) - rhs%nodes_(l)
end do
end do
end do
end block
#endif
end associate

end block
Expand Down
2 changes: 1 addition & 1 deletion test/trainable_engine_test_m.F90
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function xor_gate_with_random_weights() result(test_passes)
!! Depending on where in the random-number sequence the weights start, this test can pass for lower
!! numbers of iterations, e.g., 400000. Using more iterations gives more robust convergence.
#else
integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=52219
integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=49000
!! Reducing num_iterations yields a less robust test, but increasing num_iterations causes this
!! test to crash when compiled with the Intel ifx compiler.
#endif
Expand Down
Loading