Make -cl-fast-relaxed-math default
authorSzilárd Páll <pall.szilard@gmail.com>
Tue, 25 Oct 2016 23:29:01 +0000 (01:29 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 27 Oct 2016 12:26:31 +0000 (14:26 +0200)
The change makes fastmath default and changes the previous env-var
trigger to GMX_OCL_DISABLE_FASTMATH to allow disabling it for testing.
It is known to be faster on all supported platforms (and we use it in
CUDA too) and it has been planned to be enabled for the r'16 release.

Change-Id: I8d196c9a14785ff43aae144ed95c3cb29241c83b

docs/user-guide/environment-variables.rst
src/gromacs/gpu_utils/ocl_compiler.cpp

index df2acc761c2e131f66ed2c43c44fbfc9459ab007..15e1be8166af7ecea0553aa9b5d498018ea35519 100644 (file)
@@ -384,10 +384,8 @@ compilation of OpenCL kernels, but they are also used in device selection.
         only the flavor required for the simulation is generated and
         compiled.
 
-``GMX_OCL_FASTMATH``
-        Adds the option ``cl-fast-relaxed-math`` to the compiler
-        options (in the CUDA version this is enabled by default, it is likely that
-        the same will happen with the OpenCL version soon)
+``GMX_OCL_DISABLE_FASTMATH``
+        Prevents the use of ``-cl-fast-relaxed-math`` compiler option.
 
 ``GMX_OCL_DUMP_LOG``
         If defined, the OpenCL build log is always written to the
index d9be778045f71f91d7ad229ff6802a8080557f1c..3c5e500b42c98de42acc684963ff06e015cf2c2f 100644 (file)
@@ -174,7 +174,8 @@ selectCompilerOptions(ocl_vendor_id_t deviceVendorId)
         compilerOptions += " -cl-opt-disable";
     }
 
-    if (getenv("GMX_OCL_FASTMATH") )
+    /* Fastmath imprves performance on all supported arch */
+    if (getenv("GMX_OCL_DISABLE_FASTMATH") == NULL)
     {
         compilerOptions += " -cl-fast-relaxed-math";
     }