Skip to content

Commit

Permalink
FPE trap in DPC++ (#1244)
Browse files Browse the repository at this point in the history
Due to a bug in DPC++ compiler, we disable fpe trapping.
  • Loading branch information
WeiqunZhang authored Aug 10, 2020
1 parent a2eecef commit cd0a803
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/Base/AMReX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ 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(__PGI) || (__PGIC__ >= 16)
#if !defined(AMREX_USE_DPCPP) && (!defined(__PGI) || (__PGIC__ >= 16))
// xxxxx DPCPP todo: fpe trap
prev_fpe_excepts = fegetexcept();
if (curr_fpe_excepts != 0) {
feenableexcept(curr_fpe_excepts); // trap floating point exceptions
Expand Down

0 comments on commit cd0a803

Please sign in to comment.