-
Notifications
You must be signed in to change notification settings - Fork 407
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
Adding OpenMPTarget parallel_scan #3655
Conversation
Ignore all the removed code in OpenMP_Parallel.hpp that was just dead (commented) code before. |
typename std::enable_if< std::is_same< TagType , void >::value >::type | ||
exec_range( const FunctorType & functor | ||
, const Member ibeg , const Member iend | ||
, reference_type update , const bool final ) |
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.
Note: all the removed code is irrelevant. That was dead (commented code) from the original CPU OpenMP backend).
@@ -465,6 +466,51 @@ class ParallelScan<FunctorType, Kokkos::RangePolicy<Traits...>, | |||
//---------------------------------------- | |||
}; | |||
|
|||
template <class FunctorType, class ReturnType, class... Traits> |
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 hope you guys are proud how I avoided duplicated code :-)
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 looks good but you forgot work tags. Obviously we are not testing for it... I think we would have caught that if we enabled the sorting unit test in algotithm
#pragma omp for | ||
for (int i = 0; i < chunk_size; i++) { | ||
int64_t idx = local_offset + i; | ||
if (idx < N) a_functor(idx, element_values(team_id, i), false); |
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.
Shouldn't idx
be of type Policy::index_type
?
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.
added that
if (omp_get_thread_num() == 0) { | ||
value_type sum = 0; | ||
for (int i = 0; i < chunk_size; i++) { | ||
sum += element_values(team_id, i); |
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.
Why isn't this ValueJoin::join
?
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.
yeah I am doing that.
value_type sum = 0; | ||
for (int i = 0; i < chunk_size; i++) { | ||
sum += element_values(team_id, i); | ||
element_values(team_id, i) = sum; |
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.
ValueOps::copy
?
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.
we don't support array type scans so I think its not needed.
Added WorkTag too. |
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 reasonable to me.
No description provided.