Simplified and updated OpenCL compilation
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 5 Feb 2016 23:01:18 +0000 (23:01 +0000)
committerErik Lindahl <erik.lindahl@gmail.com>
Sun, 29 May 2016 11:31:43 +0000 (13:31 +0200)
commitb08ab12cb418d553d46d46fd67970215ee2d3d21
treec24146bcdc1c31c02f041d0bc27af121adcee3e8
parentd1e823507cc92247b57d060347a6106ca5505a06
Simplified and updated OpenCL compilation

Moved into gmx and new ocl namespace, updated variable naming, updated
string handling, treated many more error conditions, also with
exceptions, used more RAII, used more of the standard GROMACS
utility infrastructure.

Removed some string databases functions that existed merely to be
looked up once.

Changed to write OpenCL build log to file pointer provided by the
caller, if needed, rather than a separate file. This currently uses
stderr, so can't yet work well with multiple ranks, but neither did
the old approach. We need a proper MPI-aware logging module, first.

Separated the caching functionality into its own source file. Changed
the naming of binary cache to reflect the name of the kernel source
file whose binary is being cached. Noted further requirements if we
would re-activate caching at some point, but since it is still
de-activated, this is not worth further effort now.

Removed the requirement that we must be able to read source code, if
instead a binary cache is available.

Required that compileProgram compile kernels for the vendor of the
target device. This was always the behaviour, but there is no reason
to be able to select alternative things there.

Simplified the passing of preprocessor defines required by the caller
of compileProgram to the JIT compilation.

Removed use of GMX_OCL_FORCE_CPU in log file coordination, as CPU
OpenCL devices are not supported.

Refs #1720

Change-Id: I25e78526f55715c779819e96d6bf6b52ad9394c6
12 files changed:
docs/user-guide/environment-variables.rst
src/gromacs/gpu_utils/CMakeLists.txt
src/gromacs/gpu_utils/gpu_utils_ocl.cpp
src/gromacs/gpu_utils/ocl_caching.cpp [new file with mode: 0644]
src/gromacs/gpu_utils/ocl_caching.h [new file with mode: 0644]
src/gromacs/gpu_utils/ocl_compiler.cpp
src/gromacs/gpu_utils/ocl_compiler.h
src/gromacs/gpu_utils/oclutils.cpp
src/gromacs/gpu_utils/oclutils.h
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_jit_support.cpp