Task #2675: bonded CUDA offload task
Clean up organization of bonded cuda module
At https://gerrit.gromacs.org/#/c/8597/ patch set 4, Szilard noted
As discussed offline, this is not so much coordination, but more ownership / inclusion of the data structure in source files that have nothing to do with most of the data members of this struct.
The only thing that happens outside of the bonded GPU module is the creation of the host-side iList. > This could be done by moving the ownership of that data and passing the generated list to the bonded_gpu_init() -- much like the pair search generated the pair list that gets passed to the GPU module for initialization of the device-side pair list -- or alternatively using a getter in assign_bondeds_to_gpu().
src/gromacs/mdlib/forcerec.cpp PS3, Line 3084:
As discussed offline, the allocation/init of gpuBondedLists could be moved into the init call here
This seems better suited for a bonded_gpu_free() function i nthe bonded_gpu module -- which would allow avoiding to expose the declaration of GpuBondedLists.
I agree that there are some structural aspects that may be worth fixing in 2019 version. I have code for a flavour of unique_ptr that can have a custom deleter that I think will enable resolving some of these. Will consider the rest also.