SixTrack / sixtracklib

Library for single charged particle simulations in accelerators
GNU Lesser General Public License v2.1
12 stars 16 forks source link

Intel OneAPI OpenCL compiler seems to perform fused multiply-add even with fast-math switched off #131

Open martinschwinzerl opened 4 years ago

martinschwinzerl commented 4 years ago

With the Intel One API (tested on the 2021.1-beta06 release), the OpenCL compiler seems to perform some unsafe optimisations even if the no-fast-math flag from the OpenCL standard is passed to the run-time compilation stage. this results in OpenCL tests failing, in particularily

tests/sixtracklib/opencl/test_track_job_cl_opencl_cxx.cpp
tests/sixtracklib/opencl/test_track_job_cl_opencl_c99.cpp

Other environments or run-time compilers tested so far seem to not show this problem.

Short-term solution: Relax the absolute difference tolerance for these tests from currently 2e-14 to 5e-11, which seems to be large enough to accomodate the resulting differences

Proposed mid-term solution: