Merge "Merge release-2018 into master"
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 6 Jul 2018 13:32:27 +0000 (15:32 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 6 Jul 2018 13:32:27 +0000 (15:32 +0200)
1  2 
src/gromacs/gpu_utils/ocl_compiler.cpp

index bfc1f1c2c588cddbd781135d220fb95514a63266,fce784e1de1a5807d95f3a2c0f5a3711ee9ae455..3107ac8f1b2b442c17c3510467bd3e1a0e97f216
@@@ -113,7 -113,7 +113,7 @@@ writeOclBuildLog(FILE              *fpl
                                              deviceId,
                                              CL_PROGRAM_BUILD_LOG,
                                              0,
 -                                            NULL,
 +                                            nullptr,
                                              &buildLogSize);
      if (cl_error != CL_SUCCESS)
      {
                                           CL_PROGRAM_BUILD_LOG,
                                           buildLogSize,
                                           buildLog,
 -                                         NULL);
 +                                         nullptr);
          if (cl_error != CL_SUCCESS)
          {
              GMX_THROW(InternalError("Could not get OpenCL program build log, error was " + ocl_get_error_string(cl_error)));
@@@ -176,7 -176,7 +176,7 @@@ selectCompilerOptions(ocl_vendor_id_t d
      }
  
      /* Fastmath imprves performance on all supported arch */
 -    if (getenv("GMX_OCL_DISABLE_FASTMATH") == NULL)
 +    if (getenv("GMX_OCL_DISABLE_FASTMATH") == nullptr)
      {
          compilerOptions += " -cl-fast-relaxed-math";
      }
@@@ -231,7 -231,7 +231,7 @@@ getSourceRootPath(const std::string &so
          InstallationPrefixInfo      info           = getProgramContext().installationPrefix();
          std::string                 dataPathSuffix = (info.bSourceLayout ?
                                                        sourceRelativePath :
-                                                       OCL_INSTALL_DIR);
+                                                       GMX_INSTALL_OCLDIR);
          sourceRootPath = Path::join(info.path, dataPathSuffix);
      }
      else
@@@ -264,13 -264,13 +264,13 @@@ getWarpSize(cl_context context, cl_devi
  {
      cl_int      cl_error;
      const char *warpSizeKernel = "__kernel void test(__global int* test){test[get_local_id(0)] = 0;}";
 -    cl_program  program        = clCreateProgramWithSource(context, 1, (const char**)&warpSizeKernel, NULL, &cl_error);
 +    cl_program  program        = clCreateProgramWithSource(context, 1, (const char**)&warpSizeKernel, nullptr, &cl_error);
      if (cl_error != CL_SUCCESS)
      {
          GMX_THROW(InternalError("Could not create OpenCL program to determine warp size, error was " + ocl_get_error_string(cl_error)));
      }
  
 -    cl_error = clBuildProgram(program, 0, NULL, NULL, NULL, NULL);
 +    cl_error = clBuildProgram(program, 0, nullptr, nullptr, nullptr, nullptr);
      if (cl_error != CL_SUCCESS)
      {
          GMX_THROW(InternalError("Could not build OpenCL program to determine warp size, error was " + ocl_get_error_string(cl_error)));
  
      size_t warpSize = 0;
      cl_error = clGetKernelWorkGroupInfo(kernel, deviceId, CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
 -                                        sizeof(warpSize), &warpSize, NULL);
 +                                        sizeof(warpSize), &warpSize, nullptr);
      if (cl_error != CL_SUCCESS)
      {
          GMX_THROW(InternalError("Could not measure OpenCL warp size, error was " + ocl_get_error_string(cl_error)));
@@@ -497,7 -497,7 +497,7 @@@ compileProgram(FILE              *fplog
  
      /* Build the OpenCL program, keeping the status to potentially
         write to the simulation log file. */
 -    cl_int buildStatus = clBuildProgram(program, 0, NULL, preprocessorOptions.c_str(), NULL, NULL);
 +    cl_int buildStatus = clBuildProgram(program, 0, nullptr, preprocessorOptions.c_str(), nullptr, nullptr);
  
      /* Write log first, and then throw exception that the user know what is
         the issue even if the build fails. */
             => write PTX to file */
          char buffer[STRLEN];
  
 -        cl_error = clGetDeviceInfo(deviceId, CL_DEVICE_NAME, sizeof(buffer), buffer, NULL);
 +        cl_error = clGetDeviceInfo(deviceId, CL_DEVICE_NAME, sizeof(buffer), buffer, nullptr);
          if (cl_error != CL_SUCCESS)
          {
              GMX_THROW(InternalError("Could not get OpenCL device info, error was " + ocl_get_error_string(cl_error)));