Make Vector::copyDataTo able to copy from device to host and vice versa#416
Merged
Make Vector::copyDataTo able to copy from device to host and vice versa#416
Conversation
Collaborator
|
with the recent change to |
pelesh
reviewed
Mar 2, 2026
Collaborator
It is, but would require cleaning up the code where the sloppy data movement was used. |
Collaborator
Author
|
Thanks for the feedback. Fixed. Please re-review. |
shakedregev
commented
Mar 3, 2026
Missed period. Mainly for CI trigger.
shakedregev
commented
Mar 3, 2026
shakedregev
commented
Mar 3, 2026
pelesh
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Current implementation of
Vector::copyDataTomethods 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 modifyVector::copyDataToso it can copy data from any memory space to any memory space, similar asVector::copyDataFrommethods.Proposed changes
My changes allow the source and memory space to be different. I also addressed naming issues and syncing issues.
Checklist
make testandmake test_installper testing instructions). Code tested on./examples/<your_example>.exe -hto get instructions how to run examples). Code tested on:-Wall -Wpedantic -Wconversion -Wextra.Further comments
I noticed some issues that I left to not explode the scope of the PR. We should follow up on these.
copyDataFromhas similar naming and potentially syncing issuesdeviceSynchronize()seemingly arbitrarily