summaryrefslogtreecommitdiff
path: root/pstl/test
diff options
context:
space:
mode:
authorRuslan Arutyunyan <ruslan.arutyunyan@intel.com>2022-01-28 03:54:27 +0300
committerRuslan Arutyunyan <ruslan.arutyunyan@intel.com>2022-01-28 04:09:51 +0300
commit843c12d6a0cdfd64c5a92e24eb58ba9ee17ca1ee (patch)
tree1e3aec358c639ae1ef1ea69ed5b50253a6c89087 /pstl/test
parent912f1c8ce355339aaab281f5908e349453b76eca (diff)
downloadllvm-843c12d6a0cdfd64c5a92e24eb58ba9ee17ca1ee.tar.gz
[libc++][pstl] Implement tag dispatching mechanism for Parallel STL
Implement the mechanism that simplifies the execution policy/iterator category dispatching and allows to implement customizations for the parallel algorithms with adding custom tags Reviewed By: rodgert, MikeDvorskiy Differential Revision: https://reviews.llvm.org/D104492
Diffstat (limited to 'pstl/test')
-rw-r--r--pstl/test/std/numerics/numeric.ops/scan.fail.cpp10
-rw-r--r--pstl/test/support/utils.h6
2 files changed, 5 insertions, 11 deletions
diff --git a/pstl/test/std/numerics/numeric.ops/scan.fail.cpp b/pstl/test/std/numerics/numeric.ops/scan.fail.cpp
index 8202dc2207c1..b17944ae0846 100644
--- a/pstl/test/std/numerics/numeric.ops/scan.fail.cpp
+++ b/pstl/test/std/numerics/numeric.ops/scan.fail.cpp
@@ -14,16 +14,6 @@
struct CustomPolicy
{
- constexpr std::false_type
- __allow_vector()
- {
- return std::false_type{};
- }
- constexpr std::false_type
- __allow_parallel()
- {
- return std::false_type{};
- }
} policy;
int32_t
diff --git a/pstl/test/support/utils.h b/pstl/test/support/utils.h
index d22320484917..ed6d48b9471a 100644
--- a/pstl/test/support/utils.h
+++ b/pstl/test/support/utils.h
@@ -1305,7 +1305,11 @@ static void
invoke_if(Policy&&, F f)
{
#if defined(_PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN) || defined(_PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN)
- __pstl::__internal::invoke_if_not(__pstl::__internal::allow_unsequenced<Policy>(), f);
+ using decay_policy = typename std::decay<Policy>::type;
+ using allow_unsequenced =
+ std::integral_constant<bool, (std::is_same<decay_policy, std::execution::unsequenced_policy>::value ||
+ std::is_same<decay_policy, std::execution::parallel_unsequenced_policy>::value)>;
+ __pstl::__internal::__invoke_if_not(allow_unsequenced{}, f);
#else
f();
#endif