-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add EMST example #1214
Add EMST example #1214
Conversation
// #2: (0, 1, 1.41) | ||
// #3: (3, 4, 2.24) | ||
// #4: (1, 2, 2.24) | ||
printEdges(edges); |
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.
I would do printEdges(emst.edges);
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.
I did that at first. But decided to explicitly show a user how to get the edges in a separate line. Felt a bit more clear.
|
||
template <typename MemorySpace> | ||
void printEdges( | ||
Kokkos::View<ArborX::Experimental::WeightedEdge *, MemorySpace> edges) |
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.
To be pedantic one would want to ensure that the view is contiguous 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.
That would be more correct, yes. Don't think it's worthwhile, though.
examples/emst/example_emst.cpp
Outdated
{ | ||
auto edges_host = | ||
Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, edges); | ||
std::sort(edges_host.data(), edges_host.data() + edges_host.size()); |
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.
Could sort it on the device with Kokkos
Fix #1189.