-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REVIEW] Fix race condition in device_scalar::set_value #569
[REVIEW] Fix race condition in device_scalar::set_value #569
Conversation
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add _async to the name of set_value() in this PR?
That would break code in cuDF and elsewhere and I didn't want to deal with that in this PR. See #570 |
rerun tests |
@cwharris need approval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
device_scalar::set_value
performs a host to device copy to set the value of the contained object. This copy is performed asynchronously and does not perform any synchronization.Previously, the
host_value
was being passed by value. This is problematic when combined with the fact that the copy was asynchronous. This could mean that the copy would not complete before the function local copy ofhost_value
was destroyed.I remedied this by making it pass by reference and clarifying the documentation about the asynchronous behavior.