Skip to content

Commit

Permalink
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h - analyz…
Browse files Browse the repository at this point in the history
…e compare_exchange_strong result

Signed-off-by: Sergey Kopienko <[email protected]>
  • Loading branch information
SergeyKopienko committed Jun 26, 2024
1 parent 3538d15 commit a934c68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,8 @@ struct __early_exit_find_or
{
for (auto __old = __found_local.load(); __comp(__shifted_idx, __old); __old = __found_local.load())
{
__found_local.compare_exchange_strong(__old, __shifted_idx);
if (__found_local.compare_exchange_strong(__old, __shifted_idx))
break;
}
}

Expand Down Expand Up @@ -1176,7 +1177,8 @@ __parallel_find_or(oneapi::dpl::__internal::__device_backend_tag, _ExecutionPoli
for (auto __old = __found.load(); __comp(__found_local.load(), __old);
__old = __found.load())
{
__found.compare_exchange_strong(__old, __found_local.load());
if (__found.compare_exchange_strong(__old, __found_local.load()))
break;
}
}
}
Expand Down

0 comments on commit a934c68

Please sign in to comment.