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
Reduce by key, extends #1141 #2097
Conversation
} | ||
|
||
// for debugging | ||
std::ostream &operator<<(std::ostream &os, |
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'd like to see this being hidden behind a pp constant. Also, if this is enabled, it requires <iostreams>
to be included.
May I ask to change the naming convention partially used (for instance for I'm sorry to bring this up as it might seem unrelated and demeaning to the work you are doing. We try however to keep the coding style in the library as uniform as possible. |
If the new algorithm is meant to be used for non-asynchronous execution policies only (no OTOH, creating a simple wrapper for the case of asynchronous policies which launches the corresponding non-asynchronous version in a new thread would do the trick as well. This might also simplify the implementation of the non-asynchronous version. |
You added extensive doxygen comments to enable the creation of the documentation for the new algorithms. In order for the documentation to be actually created though, you'd need to add the file to the build system. Several sports would need to be touched:
Let me know if you would like to have some help with this. |
|
6cebb5d
to
51ef310
Compare
I've fixed the async execution and corrected (I believe) all the offending variable names, docs etc. |
f4a0a11
to
6b39cc0
Compare
(boost::is_base_of<std::random_access_iterator_tag, category2>::value) || | ||
(boost::is_base_of<std::output_iterator_tag, category3>::value) || | ||
(boost::is_base_of<std::output_iterator_tag, category4>::value), | ||
"iterators : Random_access for inputs and Output for outputs."); |
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.
Did you intend to use &&
instead of ||
? Also, any iterator type except input_iterators can be used as an output iterator. What you probably want to write in order to check whether an iterator conforms to the output iterator concept is:
hpx::traits::is_output_iterator<OutIter>::value ||
hpx::traits::is_forward_iterator<OutIter>::value
We also have a
hpx::traits::is_random_access_iterator<RanIter>::value
which could be used instead (this also gets rid of the boost/type_traits facilities which we replaced everywhere else in the parallelism files)..
82319aa
to
ffe1277
Compare
Stencil computes state for begin+1 to end-1, begin and end are handled separately to keep stencil simple.
Use copy_if after reduction completes to reduce the final result to unique values Return a pair of iterators to key/value end of sequence.
Clean up test and add async checks
To avoid adding extra code to unwrap futures or wait for them, and to prevent races on the internal structures, remove the asynchronous type from the policy and call parallel::algorithms with the new policy. use std::decay
This is an algorithm present in thrust:: but not included in N4409. It is useful for a number of algorithms that use stream compaction (common in visualization).