Skip to content

Commit 9046e70

Browse files
committed
GPU Standalone: trap on FPE by default only when not using ffast-math
1 parent af7c9d3 commit 9046e70

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ AddOption(outputcontrolmem, uint64_t, 0, "outputMemory", 0, "Use predefined outp
521521
AddOption(inputcontrolmem, uint64_t, 0, "inputMemory", 0, "Use predefined input buffer of this size", min(0ul), message("Using %s bytes as input memory"))
522522
AddOption(cpuAffinity, int32_t, -1, "", 0, "Pin CPU affinity to this CPU core", min(-1))
523523
AddOption(fifoScheduler, bool, false, "", 0, "Use FIFO realtime scheduler", message("Setting FIFO scheduler: %s"))
524-
AddOption(fpe, bool, true, "", 0, "Trap on floating point exceptions")
524+
AddOption(fpe, int8_t, -1, "", 0, "Trap on floating point exceptions (-1 = if no ffast-math)")
525525
AddOption(flushDenormals, bool, true, "", 0, "Enable FTZ and DAZ (Flush all denormals to zero)")
526526
AddOption(solenoidBzNominalGPU, float, -1e6f, "", 0, "Field strength of solenoid Bz in kGaus")
527527
AddOption(constBz, bool, false, "", 0, "Force constand Bz")

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ int32_t ReadConfiguration(int argc, char** argv)
142142
return 1;
143143
}
144144
}
145+
#ifdef __FAST_MATH__
146+
if (configStandalone.fpe == 1) {
147+
#else
145148
if (configStandalone.fpe) {
149+
#endif
146150
feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
147151
}
148152
if (configStandalone.flushDenormals) {
@@ -158,7 +162,7 @@ int32_t ReadConfiguration(int argc, char** argv)
158162
printf("FIFO Scheduler setting not supported on Windows\n");
159163
return 1;
160164
}
161-
if (configStandalone.fpe) {
165+
if (configStandalone.fpe == 1) {
162166
printf("FPE not supported on Windows\n");
163167
return 1;
164168
}

0 commit comments

Comments
 (0)