_ForwardIterator __j1 = __first + (__j - __d_first);
// 1. Copy elements from input to output
-# if !_PSTL_ICC_18_OMP_SIMD_BROKEN
+#if !_PSTL_ICC_18_OMP_SIMD_BROKEN
__internal::__brick_copy(__i1, __j1, __i, __is_vector);
-# else
+#else
std::copy(__i1, __j1, __i);
-# endif
+#endif
// 2. Sort elements in output sequence
std::sort(__i, __j, __comp);
},
#endif
// Enable SIMD for compilers that support OpenMP 4.0
-#if (_OPENMP >= 201307) || (__INTEL_COMPILER >= 1600) || (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || defined(__clang__)
+#if (_OPENMP >= 201307) || (__INTEL_COMPILER >= 1600) || (!defined(__INTEL_COMPILER) && _PSTL_GCC_VERSION >= 40900) || \
+ defined(__clang__)
# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
#include <pstl/internal/pstl_config.h>
-
static_assert(_PSTL_VERSION == 10000);
static_assert(_PSTL_VERSION_MAJOR == 10);
static_assert(_PSTL_VERSION_MINOR == 00);
static_assert(_PSTL_VERSION_PATCH == 0);
-int main() {
+int
+main()
+{
return 0;
}
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 specialization by policy type, in case of broken configuration
template <typename BiDirIt1, typename Size, typename Generator1, typename Generator2, typename Compare>
void
template <typename Policy, typename BiDirIt1, typename Size, typename Generator1, typename Generator2,
typename Compare>
typename std::enable_if<is_same_iterator_category<BiDirIt1, std::forward_iterator_tag>::value, void>::type
- operator()(Policy&&, BiDirIt1, BiDirIt1, BiDirIt1, BiDirIt1, Size, Size,
- Generator1, Generator2, Compare)
+ operator()(Policy&&, BiDirIt1, BiDirIt1, BiDirIt1, BiDirIt1, Size, Size, Generator1, Generator2, Compare)
{
}
};
void
operator()(Policy&& exec, std::reverse_iterator<InputIterator1> first1, std::reverse_iterator<InputIterator1> last1,
std::reverse_iterator<InputIterator2> first2, std::reverse_iterator<InputIterator2> last2,
- std::reverse_iterator<OutputIterator> out_first, std::reverse_iterator<OutputIterator> out_last,
- Compare)
+ std::reverse_iterator<OutputIterator> out_first, std::reverse_iterator<OutputIterator> out_last, Compare)
{
using namespace std;
typedef typename std::iterator_traits<std::reverse_iterator<InputIterator1>>::value_type T;
typename Predicate, typename T>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n,
- Predicate pred, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred,
+ T trash)
{
// Cleaning
std::fill_n(expected_first, n, trash);
template <typename Iterator>
typename std::enable_if<!std::is_trivial<typename std::iterator_traits<Iterator>::value_type>::value, bool>::type
-is_equal(Iterator, Iterator, Iterator)
+ is_equal(Iterator, Iterator, Iterator)
{
return true;
}
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
template <typename BiDirIt, typename Size, typename UnaryOp, typename Generator>
void
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
- operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size,
- UnaryOp unary_op, Generator generator)
+ operator()(Policy&& exec, BiDirIt first, BiDirIt last, BiDirIt exp_first, BiDirIt exp_last, Size, UnaryOp unary_op,
+ Generator generator)
{
// partition
{
}
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
- operator()(Policy&&, BiDirIt, BiDirIt, BiDirIt, BiDirIt, Size,
- UnaryOp, Generator)
+ operator()(Policy&&, BiDirIt, BiDirIt, BiDirIt, BiDirIt, Size, UnaryOp, Generator)
{
}
};
struct test_one_policy
{
-#if _PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN || _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || \
+#if _PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN || _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || \
_PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN // dummy specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Iterator2>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
Iterator data_e;
test_one_policy(Iterator b, Iterator e) : data_b(b), data_e(e) {}
-#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 specialization by policy type, in case of broken configuration
template <typename Iterator1>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
struct run_copy
{
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size, typename T>
void
typename T>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size,
- Size n, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, Size n, T trash)
{
// Cleaning
std::fill_n(expected_first, size, trash);
struct run_move
{
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void
template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size,
- Size, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size size, Size, T trash)
{
// Cleaning
std::fill_n(expected_first, size, trash);
struct run_move<Wrapper<T>>
{
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void
template <typename Policy, typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2, OutputIterator2, Size size,
- Size, Wrapper<T> trash)
+ OutputIterator out_last, OutputIterator2, OutputIterator2, Size size, Size, Wrapper<T> trash)
{
// Cleaning
std::fill_n(out_first, size, trash);
const auto m = n / 2;
auto actual_last = generate_n(exec, first, m, g);
Size count = std::count(first, actual_last, g.default_value());
- EXPECT_TRUE(count == m && actual_last == std::next(first, m),
- "generate_n wrong result for generate_n");
+ EXPECT_TRUE(count == m && actual_last == std::next(first, m), "generate_n wrong result for generate_n");
std::fill(first, actual_last, T(0));
}
}
struct run_remove
{
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename Size, typename T>
void
struct run_remove_if
{
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename Size, typename Predicate>
void
typename T>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n,
- const T& value, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, const T& value,
+ T trash)
{
// Cleaning
std::fill_n(expected_first, n, trash);
{
int32_t value;
int32_t copied_times = 0;
- constexpr explicit copy_int(int32_t val = 0) : value(val) { }
+ constexpr explicit copy_int(int32_t val = 0) : value(val) {}
constexpr copy_int&
operator=(const copy_int& other)
}
template <typename T, typename Iterator1>
- bool
- check(Iterator1, Iterator1)
+ bool check(Iterator1, Iterator1)
{
return true;
}
typename Predicate, typename T>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n,
- Predicate pred, const T& old_value, const T& new_value, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred,
+ const T& old_value, const T& new_value, T trash)
{
// Cleaning
std::fill_n(expected_first, n, trash);
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
template <typename Iterator, typename Size>
void
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 specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Iterator2>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
struct run_unique
{
-#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 specialization by policy type, in case of broken configuration
template <typename ForwardIt, typename Generator>
void
typename Predicate, typename T>
void
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n,
- Predicate pred, T trash)
+ OutputIterator out_last, OutputIterator2 expected_first, OutputIterator2, Size n, Predicate pred,
+ T trash)
{
// Cleaning
std::fill_n(expected_first, n, trash);
test<float32_t>(float32_t(42), std::equal_to<float32_t>(),
[](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); });
#if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
- test<float32_t>(float32_t(42), [](float32_t, float32_t) { return false; },
- [](int32_t j) { return float32_t(j); }, false);
+ test<float32_t>(float32_t(42), [](float32_t, float32_t) { return false; }, [](int32_t j) { return float32_t(j); },
+ false);
#endif
test_algo_basic_double<int32_t>(run_for_rnd_fw<test_non_const<int32_t>>());
for (size_t e = 0; e < (counts[c] >= 64 ? 64 : (counts[c] == 2 ? 1 : 2)); ++e)
{
Sequence<T> in(counts[c], [](size_t v) -> T { return T(v); }); //fill 0...n
- in[e] = in[e + 1] = -1; //make an adjacent pair
+ in[e] = in[e + 1] = -1; //make an adjacent pair
auto i = std::adjacent_find(in.cbegin(), in.cend(), std::equal_to<T>());
EXPECT_TRUE(i == in.cbegin() + e, "std::adjacent_find returned wrong result");
struct test_find
{
-#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 specialization by policy type, in case of broken configuration
template <typename Iterator, typename Value>
void
{
// Note that the "hit" and "miss" functions here avoid overflow issues.
test<Number>(Weird(42, OddTag()), [](int32_t) { return Number(42, OddTag()); }, // hit
- [](int32_t j) { return Number(j == 42 ? 0 : j, OddTag()); }); // miss
+ [](int32_t j) { return Number(j == 42 ? 0 : j, OddTag()); }); // miss
// Test with value that is equal to two different bit patterns (-0.0 and 0.0)
test<float32_t>(-0.0, [](int32_t j) { return j & 1 ? 0.0 : -0.0; }, // hit
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 specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Iterator2, typename Predicate>
void
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 specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Iterator2, typename Predicate>
void
struct test_find_if
{
-#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 specialization by policy type, in case of broken configuration
template <typename Iterator, typename Predicate, typename NotPredicate>
void
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 specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Size, typename Generator1, typename Generator2, typename Compare>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
template <typename Policy, typename Iterator1, typename Size, typename Generator1, typename Generator2,
typename Compare>
typename std::enable_if<!is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
- operator()(Policy&&, Iterator1, Iterator1, Iterator1, Iterator1, Size, Size,
- Generator1, Generator2, Compare)
+ operator()(Policy&&, Iterator1, Iterator1, Iterator1, Iterator1, Size, Size, Generator1, Generator2, Compare)
{
}
};
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 specialization by policy type, in case of broken configuration
template <typename Iterator, typename Size, typename T, typename Predicate>
void
struct test_is_heap
{
-#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 specialization by policy type, in case of broken configuration
template <typename Iterator, typename Predicate>
typename std::enable_if<is_same_iterator_category<Iterator, std::random_access_iterator_tag>::value, void>::type
if (m1 - first > 1)
{
#ifdef _DEBUG
-# if defined(_PSTL_PAR_BACKEND_TBB)
+# if defined(_PSTL_PAR_BACKEND_TBB)
auto p = tbb::this_task_arena::max_concurrency();
-# else
+# else
auto p = 1;
-# endif
+# endif
auto complex = std::ceil(n * std::log(float32_t(m1 - first)));
if (count_comp > complex * p)
{
template <typename Policy, typename InputIterator, typename Compare>
typename std::enable_if<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::value,
void>::type
- operator()(Policy&&, InputIterator, InputIterator, InputIterator, InputIterator,
- Compare)
+ operator()(Policy&&, InputIterator, InputIterator, InputIterator, InputIterator, Compare)
{
}
};
: d_first(b1), d_last(e1), exp_first(b2), exp_last(e2)
{
}
-#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 specialization by policy type, in case of broken configuration
template <typename InputIterator, typename Size, typename T, typename Compare>
void
typename Compare>
typename std::enable_if<!is_same_iterator_category<InputIterator, std::random_access_iterator_tag>::value,
void>::type
- operator()(Policy&&, OutputIterator, OutputIterator, OutputIterator2,
- OutputIterator2, InputIterator, InputIterator, Size, Compare)
+ operator()(Policy&&, OutputIterator, OutputIterator, OutputIterator2, OutputIterator2, InputIterator, InputIterator,
+ Size, Compare)
{
}
};
// we don't want to check equality here
// because we can't be sure it will be strictly equal for floating point types
template <typename Iterator1, typename Iterator2, typename T, typename Function>
-typename std::enable_if<std::is_floating_point<T>::value, bool>::type
-compute_and_check(Iterator1, Iterator1, Iterator2, T, Function)
+typename std::enable_if<std::is_floating_point<T>::value, bool>::type compute_and_check(Iterator1, Iterator1, Iterator2,
+ T, Function)
{
return true;
}
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 specialization by policy type, in case of broken configuration
template <typename Iterator1, typename Iterator2, typename T, typename Function>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
template <typename Policy, typename Iterator1, typename Iterator2, typename Iterator3, typename Size, typename T,
typename BinaryOp>
typename std::enable_if<TestUtils::isReverse<Iterator1>::value, void>::type
- operator()(Policy&&, Iterator1, Iterator1, Iterator2, Iterator2,
- Iterator3, Iterator3, Size, T, BinaryOp, T)
+ operator()(Policy&&, Iterator1, Iterator1, Iterator2, Iterator2, Iterator3, Iterator3, Size, T, BinaryOp, T)
{
}
};
test_by_type<int64_t>(0, [](const int64_t& a, const int64_t& b) -> int64_t { return a | b; }, XOR(),
[](const int64_t& x) -> int64_t { return x * 2; },
[](std::size_t) -> int64_t { return int64_t(rand() % 1000); });
- test_by_type<float32_t>(1.0f, std::multiplies<float32_t>(),
- [](const float32_t& a, const float32_t& b) -> float32_t { return a + b; },
- [](const float32_t& x) -> float32_t { return x + 2; },
- [](std::size_t) -> float32_t { return rand() % 1000; });
+ test_by_type<float32_t>(
+ 1.0f, std::multiplies<float32_t>(), [](const float32_t& a, const float32_t& b) -> float32_t { return a + b; },
+ [](const float32_t& x) -> float32_t { return x + 2; }, [](std::size_t) -> float32_t { return rand() % 1000; });
test_by_type<MyClass>(MyClass(), std::plus<MyClass>(), std::multiplies<MyClass>(), std::negate<MyClass>(),
[](std::size_t) -> MyClass { return MyClass(rand() % 1000); });
typename T, typename BinaryOp>
typename std::enable_if<!TestUtils::isReverse<InputIterator>::value, void>::type
operator()(Policy&& exec, InputIterator first, InputIterator last, OutputIterator out_first,
- OutputIterator out_last, OutputIterator expected_first, OutputIterator, Size n,
- UnaryOp unary_op, T init, BinaryOp binary_op, T trash)
+ OutputIterator out_last, OutputIterator expected_first, OutputIterator, Size n, UnaryOp unary_op, T init,
+ BinaryOp binary_op, T trash)
{
using namespace std;
- auto orr1 = inclusive ? transform_inclusive_scan(std::execution::seq, first, last, expected_first, binary_op,
- unary_op, init)
- : transform_exclusive_scan(std::execution::seq, first, last, expected_first, init,
- binary_op, unary_op);
+ auto orr1 =
+ inclusive
+ ? transform_inclusive_scan(std::execution::seq, first, last, expected_first, binary_op, unary_op, init)
+ : transform_exclusive_scan(std::execution::seq, first, last, expected_first, init, binary_op, unary_op);
auto orr2 = inclusive ? transform_inclusive_scan(exec, first, last, out_first, binary_op, unary_op, init)
: transform_exclusive_scan(exec, first, last, out_first, init, binary_op, unary_op);
EXPECT_TRUE(out_last == orr2, "transform...scan returned wrong iterator");
template <typename Policy, typename InputIterator, typename OutputIterator, typename Size, typename UnaryOp,
typename T, typename BinaryOp>
typename std::enable_if<TestUtils::isReverse<InputIterator>::value, void>::type
- operator()(Policy&&, InputIterator, InputIterator, OutputIterator,
- OutputIterator, OutputIterator, OutputIterator, Size,
- UnaryOp, T, BinaryOp, T)
+ operator()(Policy&&, InputIterator, InputIterator, OutputIterator, OutputIterator, OutputIterator, OutputIterator,
+ Size, UnaryOp, T, BinaryOp, T)
{
}
};
test_uninitialized_copy_move_by_type<float64_t>();
// for user-defined types
-#if !_PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN && !_PSTL_ICC_16_VC14_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 && \
!_PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN
test_uninitialized_copy_move_by_type<Wrapper<int8_t>>();
#endif
#define _PSTL_TEST_config_H
#if defined(_MSC_VER) && defined(_DEBUG)
-#define _SCL_SECURE_NO_WARNINGS //to prevent the compilation warning. Microsoft STL implementation has specific checking of an iterator range in DEBUG mode for the containers from the standard library.
+# define _SCL_SECURE_NO_WARNINGS //to prevent the compilation warning. Microsoft STL implementation has specific checking of an iterator range in DEBUG mode for the containers from the standard library.
#endif
#ifndef __clang__
-#define _PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN \
- (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER <= 1700 && !__APPLE__)
-#define _PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN \
- (!_DEBUG && __INTEL_COMPILER && \
- (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)))
-#define _PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN \
- (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)
-#define _PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN \
- (__i386__ && !_DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && __APPLE__)
-#define _PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN \
- (!_DEBUG && __INTEL_COMPILER >= 1800 && __INTEL_COMPILER < 1900 && _MSC_VER == 1910)
-#define _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
- (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && _MSC_VER >= 1900)
-#define _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
- (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1600 && __INTEL_COMPILER < 1700 && _MSC_VER == 1900)
-#define _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN \
- (((_M_X64 && _MSC_VER == 1900) || __x86_64) && !_DEBUG && __INTEL_COMPILER < 1700)
-#define _PSTL_ICC_16_17_TEST_64_TIMEOUT (__x86_64 && __INTEL_COMPILER && __INTEL_COMPILER < 1800 && !__APPLE__)
-#define _PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN (!_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800)
-#define _PSTL_CLANG_TEST_BIG_OBJ_DEBUG_32_BROKEN \
- (__i386__ && PSTL_USE_DEBUG && __clang__ && _PSTL_CLANG_VERSION <= 90000)
-#define _PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN \
- (!_DEBUG && __INTEL_COMPILER && \
- (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 3)))
-#define _PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN \
- (!_DEBUG && __INTEL_COMPILER == 1800 && __AVX__ && !__AVX2__ && !__AVX512__)
-#define _PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN \
- (!PSTL_USE_DEBUG && (__linux__ || __APPLE__) && __INTEL_COMPILER == 1900)
-#define _PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN \
- (__INTEL_COMPILER == 1900 && _MSC_VER >= 1900 && _MSC_VER <= 1910)
-#define _PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN (__INTEL_COMPILER == 1900 && _MSC_VER && !_DEBUG)
+# define _PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN \
+ (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER <= 1700 && !__APPLE__)
+# define _PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN \
+ (!_DEBUG && __INTEL_COMPILER && \
+ (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)))
+# define _PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN \
+ (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)
+# define _PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN \
+ (__i386__ && !_DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && __APPLE__)
+# define _PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN \
+ (!_DEBUG && __INTEL_COMPILER >= 1800 && __INTEL_COMPILER < 1900 && _MSC_VER == 1910)
+# define _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
+ (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && _MSC_VER >= 1900)
+# define _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
+ (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1600 && __INTEL_COMPILER < 1700 && _MSC_VER == 1900)
+# define _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN \
+ (((_M_X64 && _MSC_VER == 1900) || __x86_64) && !_DEBUG && __INTEL_COMPILER < 1700)
+# define _PSTL_ICC_16_17_TEST_64_TIMEOUT (__x86_64 && __INTEL_COMPILER && __INTEL_COMPILER < 1800 && !__APPLE__)
+# define _PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN \
+ (!_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800)
+# define _PSTL_CLANG_TEST_BIG_OBJ_DEBUG_32_BROKEN \
+ (__i386__ && PSTL_USE_DEBUG && __clang__ && _PSTL_CLANG_VERSION <= 90000)
+# define _PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN \
+ (!_DEBUG && __INTEL_COMPILER && \
+ (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 3)))
+# define _PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN \
+ (!_DEBUG && __INTEL_COMPILER == 1800 && __AVX__ && !__AVX2__ && !__AVX512__)
+# define _PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN \
+ (!PSTL_USE_DEBUG && (__linux__ || __APPLE__) && __INTEL_COMPILER == 1900)
+# define _PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN \
+ (__INTEL_COMPILER == 1900 && _MSC_VER >= 1900 && _MSC_VER <= 1910)
+# define _PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN (__INTEL_COMPILER == 1900 && _MSC_VER && !_DEBUG)
#endif // !__clang__
#endif /* _PSTL_TEST_config_H */