hoomd-blue icon indicating copy to clipboard operation
hoomd-blue copied to clipboard

MPCD and GPU polymorphism

Open mphoward opened this issue 5 years ago • 2 comments

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:

  1. 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.

  2. 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.

mphoward avatar May 29 '20 15:05 mphoward

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Apr 02 '22 19:04 github-actions[bot]

This issue has been automatically closed because it has not had recent activity.

github-actions[bot] avatar Apr 12 '22 19:04 github-actions[bot]

Fixed in #1712

mphoward avatar Mar 05 '24 14:03 mphoward