Skip to content
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

Fix Task.parallel_for_reduce on empty loop #67

Merged

Commits on Mar 9, 2022

  1. Fix Task.parallel_for_reduce on empty loop

    `Task.parallel_for_reduce` gives the wrong result for a the corner-case
    of an empty loop with `start:0` and `finish:-1`.
    
    For a simple (in this case: empty) loop that adds an array of 1s,
    it returns `1` rather than the expected `init = 0`.
    
    The current code builds on a reasonable assumption of non-empty parallel loops.
    The PR tests for the corner-case only once per invocation ("at top-level")
    and hence should not affect performance.
    jmid committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    a77a2c3 View commit details
    Browse the repository at this point in the history