From: Szilárd Páll Date: Tue, 25 Oct 2016 23:29:01 +0000 (+0200) Subject: Make -cl-fast-relaxed-math default X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=5c0c3dc2ef8ee5cb8b30f7d3f06db75882290db7;p=alexxy%2Fgromacs.git Make -cl-fast-relaxed-math default 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 --- diff --git a/docs/user-guide/environment-variables.rst b/docs/user-guide/environment-variables.rst index df2acc761c..15e1be8166 100644 --- a/docs/user-guide/environment-variables.rst +++ b/docs/user-guide/environment-variables.rst @@ -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 diff --git a/src/gromacs/gpu_utils/ocl_compiler.cpp b/src/gromacs/gpu_utils/ocl_compiler.cpp index d9be778045..3c5e500b42 100644 --- a/src/gromacs/gpu_utils/ocl_compiler.cpp +++ b/src/gromacs/gpu_utils/ocl_compiler.cpp @@ -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"; }