Skip to content

Commit 942f7ac

Browse files
authored
Try catching invalid floating point operations (#1327)
1 parent 71f0c96 commit 942f7ac

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/utf_main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <mpi.h>
1919
#endif
2020

21+
#include <cfenv>
22+
2123
struct ExecutionEnvironmentScopeGuard
2224
{
2325
ExecutionEnvironmentScopeGuard(int &argc, char *argv[])
@@ -41,5 +43,9 @@ bool init_function() { return true; }
4143
int main(int argc, char *argv[])
4244
{
4345
ExecutionEnvironmentScopeGuard scope_guard(argc, argv);
46+
// FIX_SYCL
47+
#if !defined(__APPLE__) && !defined(_WIN32) && !defined(KOKKOS_ENABLE_SYCL)
48+
feenableexcept(FE_INVALID);
49+
#endif
4450
return boost::unit_test::unit_test_main(&init_function, argc, argv);
4551
}

0 commit comments

Comments
 (0)