[NFC][pstl] Run clang-format on the sources, including the tests

llvm-svn: 366492
This commit is contained in:
Louis Dionne 2019-07-18 20:22:28 +00:00
parent 96f4970813
commit 01963cec9b
36 changed files with 108 additions and 118 deletions

View File

@ -2181,11 +2181,11 @@ __pattern_partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first,
_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);
},

View File

@ -52,7 +52,8 @@
#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))

View File

@ -8,12 +8,13 @@
#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;
}

View File

@ -20,7 +20,7 @@ using namespace TestUtils;
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
@ -60,8 +60,7 @@ struct test_one_policy
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)
{
}
};

View File

@ -48,8 +48,7 @@ struct test_merge
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;

View File

@ -44,8 +44,8 @@ struct run_copy_if
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);

View File

@ -57,14 +57,14 @@ is_equal(Iterator first, Iterator last, Iterator d_first)
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
@ -97,8 +97,8 @@ struct test_one_policy
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
{
@ -121,8 +121,7 @@ struct test_one_policy
}
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)
{
}
};

View File

@ -21,7 +21,7 @@ using namespace TestUtils;
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

View File

@ -61,7 +61,7 @@ struct test_one_policy
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

View File

@ -22,7 +22,7 @@ using namespace TestUtils;
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
@ -45,8 +45,7 @@ struct run_copy
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);
@ -75,7 +74,7 @@ template <typename T>
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
@ -97,8 +96,7 @@ struct run_move
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);
@ -118,7 +116,7 @@ template <typename T>
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
@ -140,8 +138,7 @@ struct run_move<Wrapper<T>>
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);

View File

@ -58,8 +58,7 @@ struct test_generate
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));
}
}

View File

@ -21,7 +21,7 @@ using namespace TestUtils;
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
@ -59,7 +59,7 @@ struct run_remove
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

View File

@ -24,8 +24,8 @@ struct run_remove_copy
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);

View File

@ -23,7 +23,7 @@ struct copy_int
{
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)
@ -82,8 +82,7 @@ struct test_one_policy
}
template <typename T, typename Iterator1>
bool
check(Iterator1, Iterator1)
bool check(Iterator1, Iterator1)
{
return true;
}

View File

@ -26,8 +26,8 @@ struct test_replace_copy
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);

View File

@ -74,7 +74,7 @@ struct compare<wrapper<T>>
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

View File

@ -69,7 +69,7 @@ struct comparator
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

View File

@ -21,7 +21,7 @@ using namespace TestUtils;
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

View File

@ -45,8 +45,8 @@ struct run_unique_copy
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);
@ -124,8 +124,8 @@ main()
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>>());

View File

@ -47,7 +47,7 @@ test_adjacent_find_by_type()
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");

View File

@ -21,7 +21,7 @@ using namespace TestUtils;
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
@ -85,7 +85,7 @@ main()
{
// 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

View File

@ -20,7 +20,7 @@ using namespace TestUtils;
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

View File

@ -20,7 +20,7 @@ using namespace TestUtils;
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

View File

@ -21,7 +21,7 @@ using namespace TestUtils;
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

View File

@ -68,7 +68,7 @@ is_equal(const T& x, const T& y)
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
@ -113,8 +113,7 @@ struct test_one_policy
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)
{
}
};

View File

@ -20,7 +20,7 @@ using namespace TestUtils;
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

View File

@ -35,7 +35,7 @@ struct WithCmpOp
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

View File

@ -81,11 +81,11 @@ struct test_brick_partial_sort
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)
{
@ -99,8 +99,7 @@ struct test_brick_partial_sort
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)
{
}
};

View File

@ -55,7 +55,7 @@ struct test_one_policy
: 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

View File

@ -189,8 +189,8 @@ struct test_sort_with_compare
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)
{
}
};

View File

@ -86,15 +86,15 @@ compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Functio
// 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

View File

@ -156,8 +156,7 @@ struct test_scan_with_binary_op
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)
{
}
};

View File

@ -124,10 +124,9 @@ main()
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); });

View File

@ -39,15 +39,15 @@ struct test_transform_scan
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");
@ -66,9 +66,8 @@ struct test_transform_scan
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)
{
}
};

View File

@ -133,7 +133,7 @@ main()
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

View File

@ -11,41 +11,42 @@
#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 */