Skip to content

Commit

Permalink
Re-Enable FPE Trap for SYCL
Browse files Browse the repository at this point in the history
FPE trapping was disabled for SYCL in the past due to a bug in the Intel
graphics compiler. The bug has long been fixed.

Also remove the macro for PGI, because we don't need to support PGI < 16
anymore.
  • Loading branch information
WeiqunZhang committed Jul 19, 2023
1 parent b523c32 commit fdead88
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,11 @@ amrex::Initialize (int& argc, char**& argv, bool build_parm_parse,
if (invalid) curr_fpe_excepts |= FE_INVALID;
if (divbyzero) curr_fpe_excepts |= FE_DIVBYZERO;
if (overflow) curr_fpe_excepts |= FE_OVERFLOW;
#if !defined(AMREX_USE_SYCL) && (!defined(__PGI) || (__PGIC__ >= 16))
// xxxxx SYCL todo: fpe trap
prev_fpe_excepts = fegetexcept();
if (curr_fpe_excepts != 0) {
feenableexcept(curr_fpe_excepts); // trap floating point exceptions
prev_handler_sigfpe = std::signal(SIGFPE, BLBackTrace::handler);
}
#endif

#elif defined(__APPLE__) && defined(__x86_64__)
prev_fpe_mask = _MM_GET_EXCEPTION_MASK();
Expand Down

0 comments on commit fdead88

Please sign in to comment.