Skip to content
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

Document synchronization requirements on device_buffer copy ctors #772

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions include/rmm/device_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ class device_buffer {
}

/**
* @brief Construct a new device buffer by copying from a raw pointer to an
* existing host or device memory allocation.
* @brief Construct a new device buffer by copying from a raw pointer to an existing host or
* device memory allocation.
*
* @note This function does not synchronize `stream`. `source_data` is copied on `stream`, so the
* caller is responsible for correct synchronization to ensure that `source_data` is valid when
* the copy occurs. This includes destroying `source_data` in stream order after this function is
* called, or synchronizing or waiting on `stream` after this function returns as necessary.
*
* @throws rmm::bad_alloc If creating the new allocation fails.
* @throws rmm::logic_error If `source_data` is null, and `size != 0`.
Expand Down Expand Up @@ -135,6 +140,11 @@ class device_buffer {
*`other.size() != other.capacity()`, then the size and capacity of the newly
* constructed `device_buffer` will be equal to `other.size()`.
*
* @note This function does not synchronize `stream`. `other` is copied on `stream`, so the
* caller is responsible for correct synchronization to ensure that `other` is valid when
* the copy occurs. This includes destroying `other` in stream order after this function is
* called, or synchronizing or waiting on `stream` after this function returns as necessary.
*
* @throws rmm::bad_alloc If creating the new allocation fails.
* @throws rmm::cuda_error if copying from `other` fails.
*
Expand Down