-
Notifications
You must be signed in to change notification settings - Fork 185
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 strided copy function for ParVectors #1054
Conversation
src/seq_mv/vector_device.c
Outdated
#if defined(HYPRE_USING_CUDA) || defined(HYPRE_USING_HIP) | ||
auto counting_iter = thrust::make_counting_iterator(0); | ||
|
||
HYPRE_THRUST_CALL( transform_if, counting_iter, counting_iter + size, v_data, v_data, |
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.
This call has the complexity of O(size). There should be a more efficient implementation of O(size/stride), I assume.
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.
Yes, done in b507d9c
I've also generalized the new code to accept different strides for the source and destination arrays
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.
Looks good to me. Thanks!
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.
Looks good to me too
Add
hypre_ParVectorStridedCopy
for performing a strided copy operation from a source data array to the data array of a hypre_Vector structure (x->data).The source and destination arrays can be accessed with different strides.
A strided copy means that elements are copied from the source to the destination at regular stride intervals.
To be used in MGR