Use init(..) function to build DeviceContext
commit84e5a0e6b8d7846a40a582ed8747197a0d40cd96
authorArtem Zhmurov <zhmurov@gmail.com>
Sat, 1 Feb 2020 12:27:20 +0000 (1 13:27 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 10 Mar 2020 07:02:56 +0000 (10 08:02 +0100)
treebeb377d5c82e0493babb87da1598768179a18a9b
parentfa6862b510acd7b0225580b661446c278dbb0039
Use init(..) function to build DeviceContext

This patch unifies the logic of OpenCL context creation in PME and
NBNXM by using the same init(..) function for the DeviceContext
object.

Also, the DeviceInfo is now de-referenced directly after the check
on the pointer validity and passed along as a const reference, which
improves the clarity of the code.

Refs. #3315, #3311.

Change-Id: I5ba0f530918f3340fa1a5ad3e8d60fe4e0967dab
src/gromacs/ewald/pme_gpu_program.cpp
src/gromacs/ewald/pme_gpu_program.h
src/gromacs/ewald/pme_gpu_program_impl.cpp
src/gromacs/ewald/pme_gpu_program_impl.cu
src/gromacs/ewald/pme_gpu_program_impl.h
src/gromacs/ewald/pme_gpu_program_impl_ocl.cpp
src/gromacs/gpu_utils/device_context_ocl.cpp
src/gromacs/gpu_utils/device_context_ocl.h
src/gromacs/nbnxm/opencl/nbnxm_ocl_data_mgmt.cpp