Skip to content

Change ArrayCopy to deep copy Buffer objects where possible

Kenneth Moreland requested to merge kmorel/vtk-m:arraycopy-with-buffer into master

Now that the data in an ArrayHandle is stored in Buffer objects, we now have a more efficient way of doing deep copies of memory. Rather than call Algorithm::Copy, which iterates over the array and copies each item, ArrayCopy now uses the Buffer interface to do direct device-to-device (or host-to-host) mem copies. This should be more efficent and take less time to compile.

Note that this direct Buffer copy only works if the two ArrayHandles are of the same type. If they are different, ArrayCopy still has to fall back to using Algorithm::Copy.

Also note that not all ArrayHandles are using the new ArrayHandle interface (and therefore not using Buffer objects). Thus, a fallback is still available for old ArrayHandle types.

Merge request reports