Decouple GPU force buffer management from buffer ops in NBNXM
authorArtem Zhmurov <zhmurov@gmail.com>
Wed, 11 Sep 2019 12:19:31 +0000 (14:19 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 11 Sep 2019 20:53:52 +0000 (22:53 +0200)
commit873bf0800f52e3d6c5998dae27e64f1f6e18235a
treee21f74821b4c9cd1273e34ea9dbd02c05b5c71f6
parent2498f105ec5739eb358f5e96eb41d2c0f16243a0
Decouple GPU force buffer management from buffer ops in NBNXM

When GPU-side buffer operations are used, the total forces on the
device are accumulated in NBNXM module in the local GPU buffer.
By decoupling the CPU and GPU buffer operations and making the
force buffer into an argument for the reduction function, this
commit allows to take the responsibility of the GPU forces
management from the NBNXM module to the third-party instance.

This commit is refactoring of the code in preparation for the
introduction of the GPU-side PropagatorStateData object.

TODO: Use DeviceBuffer when passing the PME GPU forces buffer.

Refs. #2816

Change-Id: I2a1f9d12fad3fb5b2ce37ca3ed3d0cb91777c468
src/gromacs/mdlib/sim_util.cpp
src/gromacs/nbnxm/atomdata.cpp
src/gromacs/nbnxm/atomdata.h
src/gromacs/nbnxm/cuda/nbnxm_buffer_ops_kernels.cuh
src/gromacs/nbnxm/cuda/nbnxm_cuda.cu
src/gromacs/nbnxm/nbnxm.cpp
src/gromacs/nbnxm/nbnxm.h
src/gromacs/nbnxm/nbnxm_gpu.h