Skip to content

Conversation

AnastasiaStulova
Copy link

@AnastasiaStulova AnastasiaStulova commented May 15, 2023

This PR changes the way iterators are advanced to achieve up to 3x speedup when using cartesian product with par execution policy in for_each.

The main idea is to keep one index that is being advanced (as a canonical induction variable) and the iterators are being computed using mod/div operation from the induction variable.

Note: this approach doesn't work well when executing with seq policy particularly when there are more than 2 iterators in cartesian product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant