Skip to content

Commit fb625b1

Browse files
authored
Merge pull request #435 from masterleinad/fix_deep_copy_signaling_NaN
Don't use Kokkos::deep_copy with signaling_NaN
2 parents c972b20 + 2bc3f5c commit fb625b1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

source/MaterialProperty.templates.hh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ void MaterialProperty<dim, n_materials, p_order, MaterialStates,
232232
#ifdef ADAMANTINE_DEBUG
233233
if constexpr (std::is_same_v<MemorySpaceType, dealii::MemorySpace::Host>)
234234
{
235-
Kokkos::deep_copy(_state, std::numeric_limits<double>::signaling_NaN());
235+
// Using Kokkos::deep_copy here is problematic because it checks if the
236+
// value is default-constructed and reading a signaling NaN causes errors in
237+
// the tests due to the floating-point environment used.
238+
std::fill(_state.data(), _state.data() + _state.size(),
239+
std::numeric_limits<double>::signaling_NaN());
236240
}
237241
#endif
238242
}

0 commit comments

Comments
 (0)