Skip to content

Commit

Permalink
include/oneapi/dpl/pstl/parallel_impl.h - add TODO for compare_exchan…
Browse files Browse the repository at this point in the history
…ge_weak

Signed-off-by: Sergey Kopienko <sergey.kopienko@intel.com>
  • Loading branch information
SergeyKopienko committed Jul 5, 2024
1 parent 32a9d32 commit d6dd3da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/oneapi/dpl/pstl/parallel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ __parallel_find(__parallel_tag<_IsVector>, _ExecutionPolicy&& __exec, _Index __f
for (_DifferenceType __old = __extremum; __comp(__k, __old);
__old = __extremum)
{
// TODO we can rewrite this using atomic::fetch_min / atomic::fetch_max without for-loop in C++26.
// Please see https://en.cppreference.com/w/cpp/atomic/atomic for details.
__extremum.compare_exchange_weak(__old, __k);
}
}
Expand Down

0 comments on commit d6dd3da

Please sign in to comment.