Skip to content

Make Vector::copyDataTo able to copy from device to host and vice versa #414

@pelesh

Description

@pelesh

Summary

Current implementation of Vector::copyDataTo methods allows for copying from host-to-host and device-to-device only. If one needs to copy from host to device one needs an additional copy operation. Need to modify Vector::copyDataTo so it can copy data from any memory space to any memory space, similar as Vector::copyDataFrom methods.

Rationale

Eliminating additional data copy when using Vector::copyDataTo calls will reduce unnecessary performance overhead. This is also required if we want to eliminate all "sloppy" data movement that Vector::getData functions do.

Description

Implement methods:

      int copyDataTo(real_type* dest, index_type i, memory::MemorySpace memspaceSrc, memory::MemorySpace memspaceDst);
      int copyDataTo(real_type* dest, memory::MemorySpace memspaceSrc, memory::MemorySpace memspaceDst);

that can copy from any memory space (host or device) to any memory space (host or device).

Additional information

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions