Differential D58852 Diff 188992 test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
- This file was moved from test/test_partition.cpp.
// -*- C++ -*- | // -*- C++ -*- | ||||
//===-- test_partition.cpp ------------------------------------------------===// | //===-- partition.pass.cpp ------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// Tests for stable_partition and partition | // Tests for stable_partition and partition | ||||
#include "pstl_test_config.h" | #include "support/pstl_test_config.h" | ||||
#include <type_traits> | |||||
#include <iterator> | |||||
#ifdef PSTL_STANDALONE_TESTS | |||||
#include "pstl/execution" | #include "pstl/execution" | ||||
#include "pstl/algorithm" | #include "pstl/algorithm" | ||||
#include "utils.h" | #else | ||||
#include <execution> | |||||
#include <algorithm> | |||||
#endif // PSTL_STANDALONE_TESTS | |||||
#include <iterator> | #include "support/parallel_utils.h" | ||||
#include <type_traits> | |||||
using namespace TestUtils; | using namespace Parallel_TestUtils; | ||||
template <typename T> | template <typename T> | ||||
struct DataType | struct DataType | ||||
{ | { | ||||
explicit DataType(int32_t k) : my_val(k) {} | explicit DataType(int32_t k) : my_val(k) {} | ||||
DataType(DataType&& input) { my_val = std::move(input.my_val); } | DataType(DataType&& input) { my_val = std::move(input.my_val); } | ||||
DataType& | DataType& | ||||
operator=(DataType&& input) | operator=(DataType&& input) | ||||
Show All 32 Lines | |||||
} | } | ||||
struct test_one_policy | struct test_one_policy | ||||
{ | { | ||||
#if __PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || \ | #if __PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || \ | ||||
__PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN //dummy specializations to skip testing in case of broken configuration | __PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN //dummy specializations to skip testing in case of broken configuration | ||||
template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | ||||
void | void | ||||
operator()(pstl::execution::unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, | operator()(__pstl::execution::unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, | ||||
Size n, UnaryOp unary_op, Generator generator) | Size n, UnaryOp unary_op, Generator generator) | ||||
{ | { | ||||
} | } | ||||
template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | ||||
void | void | ||||
operator()(pstl::execution::parallel_unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, | operator()(__pstl::execution::parallel_unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, | ||||
BiDirIt exp_last, Size n, UnaryOp unary_op, Generator generator) | BiDirIt exp_last, Size n, UnaryOp unary_op, Generator generator) | ||||
{ | { | ||||
} | } | ||||
#elif __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN //dummy specializations to skip testing in case of broken configuration | #elif __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN //dummy specializations to skip testing in case of broken configuration | ||||
template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | ||||
void | void | ||||
operator()(pstl::execution::parallel_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, | operator()(__pstl::execution::parallel_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, | ||||
Size n, UnaryOp unary_op, Generator generator) | Size n, UnaryOp unary_op, Generator generator) | ||||
{ | { | ||||
} | } | ||||
template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | ||||
void | void | ||||
operator()(pstl::execution::parallel_unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, | operator()(__pstl::execution::parallel_unsequenced_policy, BiDirIt first, BiDirIt last, BiDirIt exp_first, | ||||
BiDirIt exp_last, Size n, UnaryOp unary_op, Generator generator) | BiDirIt exp_last, Size n, UnaryOp unary_op, Generator generator) | ||||
{ | { | ||||
} | } | ||||
#endif | #endif | ||||
template <typename Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | template <typename Policy, typename BiDirIt, typename Size, typename UnaryOp, typename Generator> | ||||
typename std::enable_if<!is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::value, void>::type | typename std::enable_if<!is_same_iterator_category<BiDirIt, std::forward_iterator_tag>::value, void>::type | ||||
operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, | operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size n, | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |