Skip to content

c11_atomics: summation error estimate in fp atomic_fetch_add/sub is not an upper bound #2821

Description

@shajder

max_error in CBasicTestFetchAdd and CBasicTestFetchSub is the spread of five fixed summation orders, but the expected and tested sums use other orders (index order and thread arrival order), so a correct result can exceed it. Example with atomic_fetch_add -host (host threads only), float, 16 elements: difference 0.000732421875 (3 ulp), max_error 0.00048828125 (2 ulp).

Proposal: use the Higham worst case summation bound, as the work_group_reduce_* tests already do in test_wg_scan_reduce.cpp: Reduce::generate_input_values.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions