Disable fastmath with OpenCL on Intel devices
[alexxy/gromacs.git] / src / gromacs / gpu_utils / ocl_compiler.cpp
index 5f826e5e0ab334dffe87b54d5a26e7ddb4b2ca96..64e925b885036f74e01a9dd2049f2d790cbb5a9a 100644 (file)
@@ -169,8 +169,9 @@ static std::string selectCompilerOptions(DeviceVendor deviceVendor)
         compilerOptions += " -cl-opt-disable";
     }
 
-    /* Fastmath improves performance on all supported arch */
-    if (getenv("GMX_OCL_DISABLE_FASTMATH") == nullptr)
+    /* Fastmath improves performance on all supported arch,
+     * but is tends to cause problems on Intel (Issue #3898) */
+    if ((deviceVendor != DeviceVendor::Intel) && (getenv("GMX_OCL_DISABLE_FASTMATH") == nullptr))
     {
         compilerOptions += " -cl-fast-relaxed-math";