You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In taskflow::find_if doesn't work with infinite ranges.
However an infinite range is a reasonable input to find_if. For example
std::ranges::iota(0)
produces an infinite range starting from 0.
However taskflow::find_if calls std::distance on the two iterators which cannot work if the second iterator is a sentinel std::unreachable_sentinel
In this case taskflow::find_if should find a sensible alternative to chunking. In our case we explicitly pass StaticPartitioner(1) so we don't require chunking.
The text was updated successfully, but these errors were encountered:
We are following the C++ standard algorithm (and parallel algorithms as well) that does not check if the given iterators are valid/invalid. Invalid range iterators will result in undefined behavior.
An infinite range is not invalid. It is the taskflow code that is
problematic because it assumes that only finite ranges can be parallelized.
But I see no reason why they cannot. One just needs a constexpr test and
then branch to a different chunking strategy that is not based on the
number of items in the sequence.
In taskflow::find_if doesn't work with infinite ranges.
However an infinite range is a reasonable input to find_if. For example
std::ranges::iota(0)
produces an infinite range starting from 0.
However taskflow::find_if calls std::distance on the two iterators which cannot work if the second iterator is a sentinel std::unreachable_sentinel
In this case taskflow::find_if should find a sensible alternative to chunking. In our case we explicitly pass StaticPartitioner(1) so we don't require chunking.
The text was updated successfully, but these errors were encountered: