Current PME OpenCL code creates its own cl_context in PmeGpuProgramImpl, based on input gmx_device_info_t *.
NB with OpenCL also creates its own OpenCL context. OpenCL contexts can correspond to multiple devices:
NB and PME not sharing same cl_context on the rank can even be detrimental - it's possible they would not have access to each other's cl_mem's.
cl_context management should be taken away from PmeGpuProgramImpl/nbnxn_gpu_create_context() and put into a new class, which would get constructed from a set of gmx_device_info_t *.
The instance of this class should get created based on the GPU task assignment.
PME/NB still need to store references to this object to get the cl_context/gmx_device_info_t * out of it.
Support persistent device context-derived data in PME tests
PME OpenCL will need to not recompile kernels for running each
unit test. With this in mind, a persistent PmeGpuProgram class
is tasked with GPU kernel setup, and passed around, using a typedef.
The purpose of the class is to hold the PME program data that should
only be set up once and live forever for the given device context.
PmeGpuProgramImpl structure is now tasked with managing
function pointers to the CUDA kernels' instances, and will later
be tasked with compiling OpenCL kernels.
Take over management of OpenCL context from PME and NBNXM
This patch set creates the DeviceContext in runner and passes it to the
consumers (PME and NBNXM). This removes unnessesary management code
duplication, makes the device buffers in two modules compatible.