Skip to content

Remove duplicating H2D and D2H copy wrappers in CUDA

NBNXM module had its own wrappers for H2D and D2H operations, duplicating general copyTo/FromDeviceBuffer(...) functions. This patch removes these duplicating wrapper functions and make use of the generalized wrappers instead.

The D2H copy wrapper was failing with pinning error when asynchronous copy was called with zero elements to copy. To fix this, early return was added. This also means that synchroneos D2H call will not execute copy command and hence will not synchronize the stream. Note on that added to the description of the respective functions.

Also added assertions on the equality of sizes for elements of host and device buffers.

Refs #3320 (closed) Refs #3311 (closed)

From: https://gerrit.gromacs.org/#/c/gromacs/+/14859/

Edited by Artem Zhmurov

Merge request reports