Repository navigation
Keep host sources alive for async copies in the routing cost-boundary test and two src sites #2260
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| #include "generator.hpp" | ||
| #include "generator_utils.cuh" | ||
|
|
||
| #include <thrust/fill.h> | ||
| #include <thrust/iterator/constant_iterator.h> | ||
| #include <thrust/reduce.h> | ||
| #include <thrust/shuffle.h> | ||
|
|
@@ -207,8 +208,8 @@ coordinates_t<f_t> generate_coordinates(raft::handle_t& handle, | |
| auto depot_y = depot_x; | ||
|
|
||
| // Update depot to be in the center. | ||
| raft::copy(v_x_pos.data(), &depot_x, 1, handle.get_stream()); | ||
| raft::copy(v_y_pos.data(), &depot_y, 1, handle.get_stream()); | ||
| thrust::fill_n(handle.get_thrust_policy(), v_x_pos.begin(), 1, depot_x); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed. |
||
| thrust::fill_n(handle.get_thrust_policy(), v_y_pos.begin(), 1, depot_y); | ||
| return std::make_tuple(std::move(v_x_pos), std::move(v_y_pos)); | ||
| } | ||
|
|
||
|
|
||
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.
Same as above for
handle_ptr->get_thrust_policy(): please confirm it runs on thestreamused for the surrounding scatter, so the last offset is written in order.total_nnzis passed by value into the kernel, so the lifetime problem is gone.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.
Confirmed.
csr_to_csc_transposesetsstream = handle_ptr->get_stream()at the top and already runs itsthrust::fill,for_eachandexclusive_scanthroughhandle_ptr->get_thrust_policy(); the scatter kernel then launches onstream.get(). So thefill_nis ordered after the scan and before the scatter, on one stream.