From 224acf7423ded15d34b53429d99248c3d308b685 Mon Sep 17 00:00:00 2001 From: Sergey Kopienko Date: Wed, 19 Jun 2024 15:07:28 +0200 Subject: [PATCH] Improve performance of find_or pattern (#1624) --- include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h index b006eae051b..3ab717db63f 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h @@ -1067,7 +1067,10 @@ struct __early_exit_find_or if (__shifted_idx < __n && __pred(__shifted_idx, __rngs...)) { if constexpr (_OrTagType::value) + { __found_local.store(1); + break; + } else { for (auto __old = __found_local.load(); __comp(__shifted_idx, __old); __old = __found_local.load())