Skip to content

Commit

Permalink
Re-Enable FPE Trap for SYCL (AMReX-Codes#3430)
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.

More information about the bug. The JIT compiler computed `sqrt(-1)` and
was caught by AMReX's signal handler.
  • Loading branch information
WeiqunZhang authored Jul 19, 2023
1 parent b523c32 commit 20f9d30
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 20f9d30

Please sign in to comment.