Implement OpenCL support
authoranca <anca@streamcomputing.eu>
Sat, 10 Jan 2015 21:41:39 +0000 (23:41 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 29 Jun 2015 18:10:55 +0000 (20:10 +0200)
commite41872b6b1584f3cd582ff84de0d5061674084b8
tree0186a7c916a97c4d9670718f3d4b1ead7891eab3
parent7e6770b40cf2efcc772fab3af0518c32028a36fc
Implement OpenCL support

StreamComputing (http://www.streamcomputing.eu) has implemented the
short-ranged non-bonded interaction accleration features previously
accelerated with CUDA using OpenCL 1.1. Supported devices include
GCN-based AMD GPUs and NVIDIA GPUs.

Compilation requires an OpenCL SDK installed. This is included in
the CUDA SDK in that case.

The overall project is not complete, but Gromacs runs correctly on
supported devices. It only runs fast on AMD devices, because of a
limitation in the Nvidia driver. A list of known TODO items can be
found in docs/OpenCLTODOList.txt. Only devices with a warp/wavefront
size that is a multiple of 32 are compatible with the implementation.

Known issues include that tabulated Ewald kernels do not work (but the
analytical kernels are on by default, as with CUDA), and the blocking
behaviour of clEnqueue in Nvidia drivers means no overlap of CPU and
GPU computation occurs. Concerns about concurrency correctness with
context management, JIT compilation, and JIT caching means several
features are disabled for now. FastGen is enabled by default, so the
JIT compilation will only compile kernels needed for the current
simulation.

There is some duplication between the two GPU implementations, but
the active development expected for both of them suggests it is
not worthwhile consolidating the implementations more closely.

Change-Id: Ideaf16929028eb60e785feb8298c08e917394d0f
52 files changed:
CMakeLists.txt
cmake/FindOpenCL.cmake [new file with mode: 0644]
cmake/gmxManageOpenCL.cmake [new file with mode: 0644]
docs/CMakeLists.txt
docs/OpenCLTODOList.txt [new file with mode: 0644]
docs/conf-vars.py.cmakein
docs/conf.py
docs/install-guide/index.rst
docs/user-guide/environment-variables.rst
docs/user-guide/mdrun-performance.rst
src/CMakeLists.txt
src/buildinfo.h.cmakein
src/config.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/gmxlib/CMakeLists.txt
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/gmx_detect_hardware.cpp
src/gromacs/gmxlib/gpu_utils/CMakeLists.txt
src/gromacs/gmxlib/gpu_utils/gpu_macros.h
src/gromacs/gmxlib/gpu_utils/gpu_utils.cu
src/gromacs/gmxlib/gpu_utils/gpu_utils.h
src/gromacs/gmxlib/gpu_utils/gpu_utils_ocl.cpp [new file with mode: 0644]
src/gromacs/gmxlib/gpu_utils/ocl_compiler.cpp [new file with mode: 0644]
src/gromacs/gmxlib/gpu_utils/ocl_compiler.h [new file with mode: 0644]
src/gromacs/gmxlib/ocl_tools/CMakeLists.txt [new file with mode: 0644]
src/gromacs/gmxlib/ocl_tools/oclutils.cpp [new file with mode: 0644]
src/gromacs/gmxlib/ocl_tools/oclutils.h [new file with mode: 0644]
src/gromacs/legacyheaders/types/hw_info.h
src/gromacs/mdlib/CMakeLists.txt
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/nbnxn_cuda/CMakeLists.txt
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_gpu_data_mgmt.h
src/gromacs/mdlib/nbnxn_gpu_jit_support.h
src/gromacs/mdlib/nbnxn_gpu_types.h
src/gromacs/mdlib/nbnxn_ocl/CMakeLists.txt [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_jit_support.cpp [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_amd.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nowarp.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nvidia.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_utils.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernels.cl [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernels.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernels_fastgen.clh [moved from src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_jit_support.cu with 56% similarity]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernels_fastgen_add_twincut.clh [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_types.h [new file with mode: 0644]
src/gromacs/mdlib/nbnxn_ocl/vectype_ops.clh [new file with mode: 0644]
src/gromacs/mdlib/sim_util.cpp