I’ve created a ray tracer using OpenCL and I enable the build flag -cl-fast-relaxed-math by default as it results in a FPS increase of between 15-100% depending on the scene. However, for one specific scene (which includes a C file containing noise functions) I get significantly worse performance when this flag is enabled, specifically 20% worse than when the flag is not enabled. This scene is very simple, only featuring a sphere with the surface displaced by some 3D Perlin noise to create a basic Earth-like planet. The noise library can be found here: perlin-noise/simplexnoise1234.c at master · stegu/perlin-noise · GitHub
Is this expected behaviour to get worse performance when including C files and using this build flag? And if so, what is causing this performance decrease?