hoomd-blue
hoomd-blue copied to clipboard
MPCD and GPU polymorphism
Description
The MPCD forces are currently implemented with runtime polymorphism. This works well on the CPU but is complicated on the GPU because it requires a special wrapper to construct/destroy the force object and also needs separable device compilation. @jglaser has pointed that this polymorphism does not work on AMD GPUs. Another difficulty is how plugins can be built against hoomd.mpcd with either new streaming geometries or new forces, since they no longer have access to the unlinked device objects. We should try to figure out a better solution to this problem.
Proposed solution
Two possibilities:
-
Supply the MPCD CUDA objects unlinked as a static library (in addition to the MPCD shared library), and plugins can then complete the device link themselves. I tried unsuccessfully to get this to work in older CMake, but it may be easier with modern CMake. This doesn't fix the AMD issue, though.
-
Scrap the runtime polymorphism and template the streaming methods on the force in addition to the geometry. This will increase compile time and forces developers to template all geometries when they add a new force, but will certainly work.
There may also be changes required for how integrators, streaming methods, and forces work for the v3 API, so I'm not sure if one of these might
Developer
Yes, I can look into this when I refactor for v3.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been automatically closed because it has not had recent activity.
Fixed in #1712