Skip to content

Commit

Permalink
Add comment about using size()
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
  • Loading branch information
danhoeflinger committed Jan 13, 2025
1 parent dd35fc9 commit 455cf9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/oneapi/dpl/pstl/omp/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ struct __thread_enumerable_storage
_PSTL_PRAGMA(omp single) { __thread_specific_storage.resize(omp_get_num_threads()); }
}

// Note: Size should not be used concurrantly with parallel loops which may instantiate storage objects, as it may
// not return an accurate count of instantiated storage objects in lockstep with the number allocated and stored.
// This is because the count is not atomic with the allocation and storage of the storage objects.
std::uint32_t
size() const
{
Expand Down

0 comments on commit 455cf9c

Please sign in to comment.