Handle uniformly GMX_OCL_NOGENCACHE
authorSzilárd Páll <pall.szilard@gmail.com>
Tue, 2 Feb 2016 18:18:43 +0000 (19:18 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 8 Feb 2016 13:01:44 +0000 (14:01 +0100)
Caching is always turned off, but the code did not reflect this
everywhere.

Change-Id: I2db52b581dddf7269b6c71808760d3a8edd92969

src/gromacs/gpu_utils/ocl_compiler.cpp

index 4e43fd0e1c634829241bb7bb1edc454953260c3b..6a4772aee3ab13f1e0380614d91836c4cb5f62b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  */
 #define SEPARATOR '/'
 
+
+/*! \brief True if OpenCL binary caching is on.
+ *  Currently caching is disabled until we resolve concurrency issues. */
+static bool bCacheOclBuild = false;
+/* bCacheOclBuild = (NULL == getenv("GMX_OCL_NOGENCACHE"));*/
+
 /*! \brief Compiler options index
  */
 typedef enum {
@@ -196,7 +202,7 @@ create_ocl_build_options_length(
     if ((build_device_vendor_id == OCL_VENDOR_AMD) && getenv("GMX_OCL_DUMP_INTERM_FILES"))
     {
         /* To dump OpenCL build intermediate files, caching must be off */
-        if (NULL != getenv("GMX_OCL_NOGENCACHE"))
+        if (bCacheOclBuild)
         {
             build_options_length +=
                 get_ocl_build_option_length(b_amd_dump_temp_files) + whitespace;
@@ -891,7 +897,6 @@ ocl_compile_program(
     size_t         ocl_source_length       = 0;
     size_t         kernel_filename_len     = 0;
 
-    bool           bCacheOclBuild           = false;
     bool           bOclCacheValid           = false;
 
     char           ocl_binary_filename[256] = { 0 };
@@ -932,9 +937,7 @@ ocl_compile_program(
                                      defines_for_kernel_types,
                                      runtime_consts);
 
-    /* Check if OpenCL caching is ON - currently caching is disabled
-       until we resolve concurrency issues. */
-    /* bCacheOclBuild = (NULL == getenv("GMX_OCL_NOGENCACHE"));*/
+    /* Check if OpenCL caching is ON */
     if (bCacheOclBuild)
     {
         clGetDeviceInfo(device_id, CL_DEVICE_NAME, sizeof(ocl_binary_filename), ocl_binary_filename, NULL);