| 1050 | } |
| 1051 | |
| 1052 | FPExcept setFPExcept (FPExcept excepts) |
| 1053 | { |
| 1054 | auto prev = getFPExcept(); |
| 1055 | #if defined(__linux__) && defined(__GLIBC__) |
| 1056 | int flags = FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW; |
| 1057 | fedisableexcept(flags); |
| 1058 | flags = 0; |
| 1059 | if (any(excepts & FPExcept::invalid )) { flags |= FE_INVALID ; } |
| 1060 | if (any(excepts & FPExcept::zero )) { flags |= FE_DIVBYZERO; } |
| 1061 | if (any(excepts & FPExcept::overflow)) { flags |= FE_OVERFLOW ; } |
| 1062 | feenableexcept(flags); |
| 1063 | #else |
| 1064 | amrex::ignore_unused(excepts); |
| 1065 | #endif |
| 1066 | return prev; |
| 1067 | } |
| 1068 | |
| 1069 | FPExcept disableFPExcept (FPExcept excepts) |
| 1070 | { |
nothing calls this directly
no test coverage detected