Commit f32ee8a2 by Thomas Rodgers Committed by Thomas Rodgers

Synchronize libstdc++ PSTL with upstream LLVM PSTL

	Rename PSTL macro's consistent with libstdc++ (and llvm upstream
	project) standards.
	* include/bits/c++config: Rename all macros of the form __PSTL* to
	_PSTL*.
	* include/std/algorithm: Likewise.
	* include/std/execution: Likewise.
	* include/std/numeric: Likewise.
	* include/std/memory: Likewise.
	* include/pstl/glue_memory_impl.h: Likewise.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/glue_memory_defs.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/utils.h: Likewise.
	* include/pstl/algorithm_fwd.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/parallel_impl.h: Likewise.
	* include/pstl/memory_impl.h: Likewise.
	* include/pstl/glue_numeric_defs.h: Likewise.
	* include/pstl/parallel_backend_utils.h: Likewise.
	* include/pstl/glue_algorithm_defs.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/glue_numeric_impl.h: Likewise.
	* include/pstl/parallel_backend_tbb.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* testsuite/util/pstl/pstl_test_config.h: Likewise.
	* testsuite/util/pstl/test_utils.h: Likewise.
	* testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc:
	Likewise.
	* testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc:
	Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc:
	Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/scan.cc: Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc: Likewise.
	* testsuite/26_numerics/pstl/numeric_ops/reduce.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
	Likewise.
	* testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc: Likewise.

	Rename header guards to be consistent with upstream project's
	conventions.
	* include/pstl/glue_memory_impl.h: Rename all macros of the form
	_PSTL_(.*)_H to _PSTL_\U\1_H.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/glue_memory_defs.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/utils.h: Likewise.
	* include/pstl/algorithm_fwd.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/parallel_impl.h: Likewise.
	* include/pstl/memory_impl.h: Likewise.
	* include/pstl/glue_numeric_defs.h: Likewise.
	* include/pstl/parallel_backend_utils.h: Likewise.
	* include/pstl/glue_algorithm_defs.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/glue_numeric_impl.h: Likewise.
	* include/pstl/parallel_backend_tbb.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* testsuite/util/pstl/pstl_test_config.h: Likewise.

	Synchronize libstdc++ parallel algorithms with upstream
	project.
	* include/pstl/algorithm_fwd.h: Synchronize with
	upstream PSTL project.
	* include/pstl/algorithm_impl.h: Likewise.
	* include/pstl/execution_defs.h: Likewise.
	* include/pstl/execution_impl.h: Likewise.
	* include/pstl/glue_algorithm_impl.h: Likewise.
	* include/pstl/glue_execution_defs.h: Likewise.
	* include/pstl/numeric_fwd.h: Likewise.
	* include/pstl/numeric_impl.h: Likewise.
	* include/pstl/parallel_backend.h: Likewise.
	* include/pstl/pstl_config.h: Likewise.
	* include/pstl/unseq_backend_simd.h: Likewise.
	* include/pstl/parallel_backend_serial.h: New file.
	* include/Makefile.am (pstl_headers): Add
	parallel_backend_serial.h.
	* include/Makefile.in: Regenerate.

	Clean up non-conforming names
	* include/pstl/algorithm_impl.h (__parallel_set_union_op):
	Uglfiy copy_range1 and copy_range2
	(__pattern_walk2_n): Rename local n to __n
	* include/pstl/parallel_backend_tbb.h (struct __binary_no_op):
	Rename parameter _T to _Tp.

	Integrate non-TBB serial backend support
	* include/bits/c++config: Adjust TBB detection logic to select serial
	PSTL backend if no TBB present.
	* testsuite/utils/pstl/test_utils.h: Remove check for
	_PSTL_USE_PAR_POLICIES

From-SVN: r272056
parent 1afab7a8
2019-06-07 Thomas Rodgers <trodgers@redhat.com>
Rename PSTL macro's consistent with libstdc++ (and llvm upstream
project) standards.
* include/bits/c++config: Rename all macros of the form __PSTL* to
_PSTL*.
* include/std/algorithm: Likewise.
* include/std/execution: Likewise.
* include/std/numeric: Likewise.
* include/std/memory: Likewise.
* include/pstl/glue_memory_impl.h: Likewise.
* include/pstl/numeric_impl.h: Likewise.
* include/pstl/glue_memory_defs.h: Likewise.
* include/pstl/execution_defs.h: Likewise.
* include/pstl/utils.h: Likewise.
* include/pstl/algorithm_fwd.h: Likewise.
* include/pstl/unseq_backend_simd.h: Likewise.
* include/pstl/glue_execution_defs.h: Likewise.
* include/pstl/algorithm_impl.h: Likewise.
* include/pstl/parallel_impl.h: Likewise.
* include/pstl/memory_impl.h: Likewise.
* include/pstl/glue_numeric_defs.h: Likewise.
* include/pstl/parallel_backend_utils.h: Likewise.
* include/pstl/glue_algorithm_defs.h: Likewise.
* include/pstl/parallel_backend.h: Likewise.
* include/pstl/glue_numeric_impl.h: Likewise.
* include/pstl/parallel_backend_tbb.h: Likewise.
* include/pstl/numeric_fwd.h: Likewise.
* include/pstl/glue_algorithm_impl.h: Likewise.
* include/pstl/execution_impl.h: Likewise.
* include/pstl/pstl_config.h: Likewise.
* testsuite/util/pstl/pstl_test_config.h: Likewise.
* testsuite/util/pstl/test_utils.h: Likewise.
* testsuite/20_util/specialized_algorithms/pstl/uninitialized_construct.cc:
Likewise.
* testsuite/20_util/specialized_algorithms/pstl/uninitialized_copy_move.cc:
Likewise.
* testsuite/26_numerics/pstl/numeric_ops/adjacent_difference.cc:
Likewise.
* testsuite/26_numerics/pstl/numeric_ops/scan.cc: Likewise.
* testsuite/26_numerics/pstl/numeric_ops/transform_scan.cc: Likewise.
* testsuite/26_numerics/pstl/numeric_ops/reduce.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/nth_element.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_end.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_if.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/none_of.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/count.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/reverse_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/equal.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/search_n.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/all_of.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/find_first_of.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/is_heap.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/partial_sort.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/partial_sort_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_sorting/lexicographical_compare.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_merge/merge.cc: Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/unique_copy_equal.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/replace_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/is_partitioned.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/remove.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_if.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/partition_copy.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/partition.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/copy_move.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/unique.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_modifying_operations/rotate.cc:
Likewise.
* testsuite/25_algorithms/pstl/alg_nonmodifying/any_of.cc: Likewise.
Rename header guards to be consistent with upstream project's
conventions.
* include/pstl/glue_memory_impl.h: Rename all macros of the form
_PSTL_(.*)_H to _PSTL_\U\1_H.
* include/pstl/numeric_impl.h: Likewise.
* include/pstl/glue_memory_defs.h: Likewise.
* include/pstl/execution_defs.h: Likewise.
* include/pstl/utils.h: Likewise.
* include/pstl/algorithm_fwd.h: Likewise.
* include/pstl/unseq_backend_simd.h: Likewise.
* include/pstl/glue_execution_defs.h: Likewise.
* include/pstl/algorithm_impl.h: Likewise.
* include/pstl/parallel_impl.h: Likewise.
* include/pstl/memory_impl.h: Likewise.
* include/pstl/glue_numeric_defs.h: Likewise.
* include/pstl/parallel_backend_utils.h: Likewise.
* include/pstl/glue_algorithm_defs.h: Likewise.
* include/pstl/parallel_backend.h: Likewise.
* include/pstl/glue_numeric_impl.h: Likewise.
* include/pstl/parallel_backend_tbb.h: Likewise.
* include/pstl/numeric_fwd.h: Likewise.
* include/pstl/glue_algorithm_impl.h: Likewise.
* include/pstl/execution_impl.h: Likewise.
* include/pstl/pstl_config.h: Likewise.
* testsuite/util/pstl/pstl_test_config.h: Likewise.
Synchronize libstdc++ parallel algorithms with upstream
project.
* include/pstl/algorithm_fwd.h: Synchronize with
upstream PSTL project.
* include/pstl/algorithm_impl.h: Likewise.
* include/pstl/execution_defs.h: Likewise.
* include/pstl/execution_impl.h: Likewise.
* include/pstl/glue_algorithm_impl.h: Likewise.
* include/pstl/glue_execution_defs.h: Likewise.
* include/pstl/numeric_fwd.h: Likewise.
* include/pstl/numeric_impl.h: Likewise.
* include/pstl/parallel_backend.h: Likewise.
* include/pstl/pstl_config.h: Likewise.
* include/pstl/unseq_backend_simd.h: Likewise.
* include/pstl/parallel_backend_serial.h: New file.
* include/Makefile.am (pstl_headers): Add
parallel_backend_serial.h.
* include/Makefile.in: Regenerate.
Clean up non-conforming names
* include/pstl/algorithm_impl.h (__parallel_set_union_op):
Uglfiy copy_range1 and copy_range2
(__pattern_walk2_n): Rename local n to __n
* include/pstl/parallel_backend_tbb.h (struct __binary_no_op):
Rename parameter _T to _Tp.
Integrate non-TBB serial backend support
* include/bits/c++config: Adjust TBB detection logic to select serial
PSTL backend if no TBB present.
* testsuite/utils/pstl/test_utils.h: Remove check for
_PSTL_USE_PAR_POLICIES
2019-06-07 Jonathan Wakely <jwakely@redhat.com> 2019-06-07 Jonathan Wakely <jwakely@redhat.com>
* testsuite/24_iterators/container_access.cc: Move dg-options before * testsuite/24_iterators/container_access.cc: Move dg-options before
......
...@@ -246,6 +246,7 @@ pstl_headers = \ ...@@ -246,6 +246,7 @@ pstl_headers = \
${pstl_srcdir}/numeric_impl.h \ ${pstl_srcdir}/numeric_impl.h \
${pstl_srcdir}/parallel_backend.h \ ${pstl_srcdir}/parallel_backend.h \
${pstl_srcdir}/parallel_backend_tbb.h \ ${pstl_srcdir}/parallel_backend_tbb.h \
${pstl_srcdir}/parallel_backend_serial.h \
${pstl_srcdir}/parallel_backend_utils.h \ ${pstl_srcdir}/parallel_backend_utils.h \
${pstl_srcdir}/parallel_impl.h \ ${pstl_srcdir}/parallel_impl.h \
${pstl_srcdir}/pstl_config.h \ ${pstl_srcdir}/pstl_config.h \
......
...@@ -591,6 +591,7 @@ pstl_headers = \ ...@@ -591,6 +591,7 @@ pstl_headers = \
${pstl_srcdir}/numeric_impl.h \ ${pstl_srcdir}/numeric_impl.h \
${pstl_srcdir}/parallel_backend.h \ ${pstl_srcdir}/parallel_backend.h \
${pstl_srcdir}/parallel_backend_tbb.h \ ${pstl_srcdir}/parallel_backend_tbb.h \
${pstl_srcdir}/parallel_backend_serial.h \
${pstl_srcdir}/parallel_backend_utils.h \ ${pstl_srcdir}/parallel_backend_utils.h \
${pstl_srcdir}/parallel_impl.h \ ${pstl_srcdir}/parallel_impl.h \
${pstl_srcdir}/pstl_config.h \ ${pstl_srcdir}/pstl_config.h \
......
...@@ -656,9 +656,7 @@ namespace std ...@@ -656,9 +656,7 @@ namespace std
#if __cplusplus >= 201703L #if __cplusplus >= 201703L
// Preserved here so we have some idea which version of upstream we've pulled in // Preserved here so we have some idea which version of upstream we've pulled in
// #define PSTL_VERSION 104 // #define PSTL_VERSION 9000
// #define PSTL_VERSION_MAJOR (PSTL_VERSION/100)
// #define PSTL_VERSION_MINOR (PSTL_VERSION - PSTL_VERSION_MAJOR * 100)
// For now this defaults to being based on the presence of Thread Building Blocks // For now this defaults to being based on the presence of Thread Building Blocks
# ifndef _GLIBCXX_USE_TBB_PAR_BACKEND # ifndef _GLIBCXX_USE_TBB_PAR_BACKEND
...@@ -666,11 +664,13 @@ namespace std ...@@ -666,11 +664,13 @@ namespace std
# endif # endif
// This section will need some rework when a new (default) backend type is added // This section will need some rework when a new (default) backend type is added
# if _GLIBCXX_USE_TBB_PAR_BACKEND # if _GLIBCXX_USE_TBB_PAR_BACKEND
# define __PSTL_USE_PAR_POLICIES 1 # define _PSTL_PAR_BACKEND_TBB
# else
# define _PSTL_PAR_BACKEND_SERIAL
# endif # endif
# define __PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition) # define _PSTL_ASSERT(_Condition) __glibcxx_assert(_Condition)
# define __PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition) # define _PSTL_ASSERT_MSG(_Condition, _Message) __glibcxx_assert(_Condition)
#include <pstl/pstl_config.h> #include <pstl/pstl_config.h>
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_execution_policy_defs_H #ifndef _PSTL_EXECUTION_POLICY_DEFS_H
#define __PSTL_execution_policy_defs_H #define _PSTL_EXECUTION_POLICY_DEFS_H
#include <type_traits> #include <type_traits>
...@@ -41,7 +41,6 @@ class sequenced_policy ...@@ -41,7 +41,6 @@ class sequenced_policy
} }
}; };
#if __PSTL_USE_PAR_POLICIES
// 2.5, Parallel execution policy // 2.5, Parallel execution policy
class parallel_policy class parallel_policy
{ {
...@@ -85,7 +84,6 @@ class parallel_unsequenced_policy ...@@ -85,7 +84,6 @@ class parallel_unsequenced_policy
return std::true_type{}; return std::true_type{};
} }
}; };
#endif
class unsequenced_policy class unsequenced_policy
{ {
...@@ -110,10 +108,8 @@ class unsequenced_policy ...@@ -110,10 +108,8 @@ class unsequenced_policy
// 2.8, Execution policy objects // 2.8, Execution policy objects
constexpr sequenced_policy seq{}; constexpr sequenced_policy seq{};
#if __PSTL_USE_PAR_POLICIES
constexpr parallel_policy par{}; constexpr parallel_policy par{};
constexpr parallel_unsequenced_policy par_unseq{}; constexpr parallel_unsequenced_policy par_unseq{};
#endif
constexpr unsequenced_policy unseq{}; constexpr unsequenced_policy unseq{};
// 2.3, Execution policy type trait // 2.3, Execution policy type trait
...@@ -126,7 +122,6 @@ template <> ...@@ -126,7 +122,6 @@ template <>
struct is_execution_policy<__pstl::execution::sequenced_policy> : std::true_type struct is_execution_policy<__pstl::execution::sequenced_policy> : std::true_type
{ {
}; };
#if __PSTL_USE_PAR_POLICIES
template <> template <>
struct is_execution_policy<__pstl::execution::parallel_policy> : std::true_type struct is_execution_policy<__pstl::execution::parallel_policy> : std::true_type
{ {
...@@ -135,13 +130,12 @@ template <> ...@@ -135,13 +130,12 @@ template <>
struct is_execution_policy<__pstl::execution::parallel_unsequenced_policy> : std::true_type struct is_execution_policy<__pstl::execution::parallel_unsequenced_policy> : std::true_type
{ {
}; };
#endif
template <> template <>
struct is_execution_policy<__pstl::execution::unsequenced_policy> : std::true_type struct is_execution_policy<__pstl::execution::unsequenced_policy> : std::true_type
{ {
}; };
#if __PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT #if _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
template <class _Tp> template <class _Tp>
constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<_Tp>::value; constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<_Tp>::value;
#endif #endif
...@@ -165,4 +159,4 @@ using __enable_if_execution_policy = ...@@ -165,4 +159,4 @@ using __enable_if_execution_policy =
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_execution_policy_defs_H */ #endif /* _PSTL_EXECUTION_POLICY_DEFS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_execution_impl_H #ifndef _PSTL_EXECUTION_IMPL_H
#define __PSTL_execution_impl_H #define _PSTL_EXECUTION_IMPL_H
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
...@@ -54,8 +54,8 @@ __lazy_or(_Tp __a, std::false_type) ...@@ -54,8 +54,8 @@ __lazy_or(_Tp __a, std::false_type)
template <typename _IteratorType, typename... _OtherIteratorTypes> template <typename _IteratorType, typename... _OtherIteratorTypes>
struct __is_random_access_iterator struct __is_random_access_iterator
{ {
static constexpr bool value = static constexpr bool value = __internal::__is_random_access_iterator<_IteratorType>::value &&
__internal::__is_random_access_iterator<_IteratorType>::value && __internal::__is_random_access_iterator<_OtherIteratorTypes...>::value; __internal::__is_random_access_iterator<_OtherIteratorTypes...>::value;
typedef std::integral_constant<bool, value> type; typedef std::integral_constant<bool, value> type;
}; };
...@@ -87,7 +87,6 @@ struct __policy_traits<unsequenced_policy> ...@@ -87,7 +87,6 @@ struct __policy_traits<unsequenced_policy>
typedef std::true_type allow_vector; typedef std::true_type allow_vector;
}; };
#if __PSTL_USE_PAR_POLICIES
template <> template <>
struct __policy_traits<parallel_policy> struct __policy_traits<parallel_policy>
{ {
...@@ -103,53 +102,60 @@ struct __policy_traits<parallel_unsequenced_policy> ...@@ -103,53 +102,60 @@ struct __policy_traits<parallel_unsequenced_policy>
typedef std::true_type allow_unsequenced; typedef std::true_type allow_unsequenced;
typedef std::true_type allow_vector; typedef std::true_type allow_vector;
}; };
#endif
template <typename _ExecutionPolicy> template <typename _ExecutionPolicy>
using __collector_t = typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__collector_type; using __collector_t =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__collector_type;
template <typename _ExecutionPolicy> template <typename _ExecutionPolicy>
using __allow_vector = typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_vector; using __allow_vector =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_vector;
template <typename _ExecutionPolicy> template <typename _ExecutionPolicy>
using __allow_unsequenced = typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_unsequenced; using __allow_unsequenced =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_unsequenced;
template <typename _ExecutionPolicy> template <typename _ExecutionPolicy>
using __allow_parallel = typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_parallel; using __allow_parallel =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_parallel;
template <typename _ExecutionPolicy, typename... _IteratorTypes> template <typename _ExecutionPolicy, typename... _IteratorTypes>
auto auto
__is_vectorization_preferred(_ExecutionPolicy&& __exec) __is_vectorization_preferred(_ExecutionPolicy&& __exec)
-> decltype(__internal::__lazy_and(__exec.__allow_vector(), typename __internal::__is_random_access_iterator<_IteratorTypes...>::type())) -> decltype(__internal::__lazy_and(__exec.__allow_vector(),
typename __internal::__is_random_access_iterator<_IteratorTypes...>::type()))
{ {
return __internal::__lazy_and(__exec.__allow_vector(), typename __internal::__is_random_access_iterator<_IteratorTypes...>::type()); return __internal::__lazy_and(__exec.__allow_vector(),
typename __internal::__is_random_access_iterator<_IteratorTypes...>::type());
} }
template <typename _ExecutionPolicy, typename... _IteratorTypes> template <typename _ExecutionPolicy, typename... _IteratorTypes>
auto auto
__is_parallelization_preferred(_ExecutionPolicy&& __exec) __is_parallelization_preferred(_ExecutionPolicy&& __exec)
-> decltype(__internal::__lazy_and(__exec.__allow_parallel(), typename __internal::__is_random_access_iterator<_IteratorTypes...>::type())) -> decltype(__internal::__lazy_and(__exec.__allow_parallel(),
typename __internal::__is_random_access_iterator<_IteratorTypes...>::type()))
{ {
return __internal::__lazy_and(__exec.__allow_parallel(), typename __internal::__is_random_access_iterator<_IteratorTypes...>::type()); return __internal::__lazy_and(__exec.__allow_parallel(),
typename __internal::__is_random_access_iterator<_IteratorTypes...>::type());
} }
template <typename policy, typename... _IteratorTypes> template <typename policy, typename... _IteratorTypes>
struct __prefer_unsequenced_tag struct __prefer_unsequenced_tag
{ {
static constexpr bool value = static constexpr bool value = __internal::__allow_unsequenced<policy>::value &&
__internal::__allow_unsequenced<policy>::value && __internal::__is_random_access_iterator<_IteratorTypes...>::value; __internal::__is_random_access_iterator<_IteratorTypes...>::value;
typedef std::integral_constant<bool, value> type; typedef std::integral_constant<bool, value> type;
}; };
template <typename policy, typename... _IteratorTypes> template <typename policy, typename... _IteratorTypes>
struct __prefer_parallel_tag struct __prefer_parallel_tag
{ {
static constexpr bool value = static constexpr bool value = __internal::__allow_parallel<policy>::value &&
__internal::__allow_parallel<policy>::value && __internal::__is_random_access_iterator<_IteratorTypes...>::value; __internal::__is_random_access_iterator<_IteratorTypes...>::value;
typedef std::integral_constant<bool, value> type; typedef std::integral_constant<bool, value> type;
}; };
} // namespace __internal } // namespace __internal
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_execution_impl_H */ #endif /* _PSTL_EXECUTION_IMPL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_algorithm_defs_H #ifndef _PSTL_GLUE_ALGORITHM_DEFS_H
#define __PSTL_glue_algorithm_defs_H #define _PSTL_GLUE_ALGORITHM_DEFS_H
#include <functional> #include <functional>
...@@ -548,4 +548,4 @@ lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ ...@@ -548,4 +548,4 @@ lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _
_ForwardIterator2 __first2, _ForwardIterator2 __last2); _ForwardIterator2 __first2, _ForwardIterator2 __last2);
} // namespace std } // namespace std
#endif /* __PSTL_glue_algorithm_defs_H */ #endif /* _PSTL_GLUE_ALGORITHM_DEFS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_algorithm_impl_H #ifndef _PSTL_GLUE_ALGORITHM_IMPL_H
#define __PSTL_glue_algorithm_impl_H #define _PSTL_GLUE_ALGORITHM_IMPL_H
#include <functional> #include <functional>
...@@ -745,11 +745,11 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> ...@@ -745,11 +745,11 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _BinaryPredicate __p) _ForwardIterator2 __last2, _BinaryPredicate __p)
{ {
//TODO: to get rid of "distance" using namespace __pstl;
if (std::distance(__first1, __last1) == std::distance(__first2, __last2)) return __internal::__pattern_equal(
return std::equal(__first1, __last1, __first2, __p); std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __p,
else __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec),
return false; __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec));
} }
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
...@@ -1179,4 +1179,4 @@ lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ ...@@ -1179,4 +1179,4 @@ lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _
} // namespace std } // namespace std
#endif /* __PSTL_glue_algorithm_impl_H */ #endif /* _PSTL_GLUE_ALGORITHM_IMPL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_execution_defs_H #ifndef _PSTL_GLUE_EXECUTION_DEFS_H
#define __PSTL_glue_execution_defs_H #define _PSTL_GLUE_EXECUTION_DEFS_H
#include <type_traits> #include <type_traits>
...@@ -18,29 +18,27 @@ namespace std ...@@ -18,29 +18,27 @@ namespace std
{ {
// Type trait // Type trait
using __pstl::execution::is_execution_policy; using __pstl::execution::is_execution_policy;
#if __PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT #if _PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
#if __INTEL_COMPILER # if __INTEL_COMPILER
template <class T> template <class T>
constexpr bool is_execution_policy_v = is_execution_policy<T>::value; constexpr bool is_execution_policy_v = is_execution_policy<T>::value;
#else # else
using __pstl::execution::is_execution_policy_v; using __pstl::execution::is_execution_policy_v;
#endif # endif
#endif #endif
namespace execution namespace execution
{ {
// Standard C++ policy classes // Standard C++ policy classes
using __pstl::execution::sequenced_policy;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::parallel_policy; using __pstl::execution::parallel_policy;
using __pstl::execution::parallel_unsequenced_policy; using __pstl::execution::parallel_unsequenced_policy;
#endif using __pstl::execution::sequenced_policy;
// Standard predefined policy instances // Standard predefined policy instances
using __pstl::execution::seq;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::par; using __pstl::execution::par;
using __pstl::execution::par_unseq; using __pstl::execution::par_unseq;
#endif using __pstl::execution::seq;
// Implementation-defined names // Implementation-defined names
// Unsequenced policy is not yet standard, but for consistency // Unsequenced policy is not yet standard, but for consistency
// we include it into namespace std::execution as well // we include it into namespace std::execution as well
...@@ -53,4 +51,4 @@ using __pstl::execution::unsequenced_policy; ...@@ -53,4 +51,4 @@ using __pstl::execution::unsequenced_policy;
#include "numeric_impl.h" #include "numeric_impl.h"
#include "parallel_backend.h" #include "parallel_backend.h"
#endif /* __PSTL_glue_execution_defs_H */ #endif /* _PSTL_GLUE_EXECUTION_DEFS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_memory_defs_H #ifndef _PSTL_GLUE_MEMORY_DEFS_H
#define __PSTL_glue_memory_defs_H #define _PSTL_GLUE_MEMORY_DEFS_H
#include "execution_defs.h" #include "execution_defs.h"
...@@ -76,4 +76,4 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardItera ...@@ -76,4 +76,4 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardItera
uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n); uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n);
} // namespace std } // namespace std
#endif /* __PSTL_glue_memory_defs_H */ #endif /* _PSTL_GLUE_MEMORY_DEFS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_memory_impl_H #ifndef _PSTL_GLUE_MEMORY_IMPL_H
#define __PSTL_glue_memory_impl_H #define _PSTL_GLUE_MEMORY_IMPL_H
#include "utils.h" #include "utils.h"
#include "algorithm_fwd.h" #include "algorithm_fwd.h"
...@@ -355,4 +355,4 @@ uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __fi ...@@ -355,4 +355,4 @@ uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __fi
} // namespace std } // namespace std
#endif /* __PSTL_glue_memory_imple_H */ #endif /* _PSTL_GLUE_MEMORY_IMPL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_numeric_defs_H #ifndef _PSTL_GLUE_NUMERIC_DEFS_H
#define __PSTL_glue_numeric_defs_H #define _PSTL_GLUE_NUMERIC_DEFS_H
#include "execution_defs.h" #include "execution_defs.h"
...@@ -113,4 +113,4 @@ adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Forwa ...@@ -113,4 +113,4 @@ adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Forwa
_ForwardIterator2 __d_first); _ForwardIterator2 __d_first);
} // namespace std } // namespace std
#endif /* __PSTL_glue_numeric_defs_H */ #endif /* _PSTL_GLUE_NUMERIC_DEFS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_glue_numeric_impl_H #ifndef _PSTL_GLUE_NUMERIC_IMPL_H
#define __PSTL_glue_numeric_impl_H #define _PSTL_GLUE_NUMERIC_IMPL_H
#include <functional> #include <functional>
...@@ -221,4 +221,4 @@ adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Forwa ...@@ -221,4 +221,4 @@ adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Forwa
} // namespace std } // namespace std
#endif /* __PSTL_glue_numeric_impl_H_ */ #endif /* _PSTL_GLUE_NUMERIC_IMPL_H_ */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_memory_impl_H #ifndef _PSTL_MEMORY_IMPL_H
#define __PSTL_memory_impl_H #define _PSTL_MEMORY_IMPL_H
#include <iterator> #include <iterator>
...@@ -53,4 +53,4 @@ __brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _O ...@@ -53,4 +53,4 @@ __brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _O
} // namespace __internal } // namespace __internal
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_memory_impl_H */ #endif /* _PSTL_MEMORY_IMPL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_numeric_fwd_H #ifndef _PSTL_NUMERIC_FWD_H
#define __PSTL_numeric_fwd_H #define _PSTL_NUMERIC_FWD_H
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
...@@ -39,14 +39,12 @@ __pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterat ...@@ -39,14 +39,12 @@ __pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterat
_BinaryOperation1, _BinaryOperation2, _IsVector, _BinaryOperation1, _BinaryOperation2, _IsVector,
/*is_parallel=*/std::false_type) noexcept; /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Tp, template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2, class _IsVector> class _BinaryOperation1, class _BinaryOperation2, class _IsVector>
_Tp _Tp
__pattern_transform_reduce(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, __pattern_transform_reduce(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
_Tp, _BinaryOperation1, _BinaryOperation2, _IsVector __is_vector, _Tp, _BinaryOperation1, _BinaryOperation2, _IsVector __is_vector,
/*is_parallel=*/std::true_type); /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// transform_reduce (version with unary and binary functions) // transform_reduce (version with unary and binary functions)
...@@ -67,14 +65,12 @@ __pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterato ...@@ -67,14 +65,12 @@ __pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterato
_UnaryOperation, _IsVector, _UnaryOperation, _IsVector,
/*is_parallel=*/std::false_type) noexcept; /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation, template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation,
class _IsVector> class _IsVector>
_Tp _Tp
__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, __pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation,
_UnaryOperation, _IsVector, _UnaryOperation, _IsVector,
/*is_parallel=*/std::true_type); /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// transform_exclusive_scan // transform_exclusive_scan
...@@ -99,21 +95,17 @@ __pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, ...@@ -99,21 +95,17 @@ __pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator,
_BinaryOperation, _Inclusive, _IsVector, _BinaryOperation, _Inclusive, _IsVector,
/*is_parallel=*/std::false_type) noexcept; /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp, template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector> class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<!std::is_floating_point<_Tp>::value, _OutputIterator>::type typename std::enable_if<!std::is_floating_point<_Tp>::value, _OutputIterator>::type
__pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator, __pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
_UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type); _UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
#endif
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp, template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector> class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<std::is_floating_point<_Tp>::value, _OutputIterator>::type typename std::enable_if<std::is_floating_point<_Tp>::value, _OutputIterator>::type
__pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator, __pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
_UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type); _UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// adjacent_difference // adjacent_difference
...@@ -133,14 +125,12 @@ _OutputIterator ...@@ -133,14 +125,12 @@ _OutputIterator
__pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation, __pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
_IsVector, /*is_parallel*/ std::false_type) noexcept; _IsVector, /*is_parallel*/ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation, template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation,
class _IsVector> class _IsVector>
_OutputIterator _OutputIterator
__pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation, __pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
_IsVector, /*is_parallel*/ std::true_type); _IsVector, /*is_parallel*/ std::true_type);
#endif
} // namespace __internal } // namespace __internal
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_numeric_fwd_H */ #endif /* _PSTL_NUMERIC_FWD_H */
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_parallel_backend_H #ifndef _PSTL_PARALLEL_BACKEND_H
#define __PSTL_parallel_backend_H #define _PSTL_PARALLEL_BACKEND_H
#if __PSTL_PAR_BACKEND_TBB #if defined(_PSTL_PAR_BACKEND_SERIAL)
#include "parallel_backend_tbb.h" # include "parallel_backend_serial.h"
#elif defined(_PSTL_PAR_BACKEND_TBB)
# include "parallel_backend_tbb.h"
#else #else
__PSTL_PRAGMA_MESSAGE("Parallel backend was not specified"); _PSTL_PRAGMA_MESSAGE("Parallel backend was not specified");
#endif #endif
#endif /* __PSTL_parallel_backend_H */ #endif /* _PSTL_PARALLEL_BACKEND_H */
// -*- C++ -*-
//===-- parallel_backend_serial.h -----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _PSTL_PARALLEL_BACKEND_SERIAL_H
#define _PSTL_PARALLEL_BACKEND_SERIAL_H
#include <algorithm>
#include <cstddef>
#include <memory>
#include <numeric>
#include <utility>
namespace __pstl
{
namespace __serial
{
template <typename _Tp>
class __buffer
{
std::allocator<_Tp> __allocator_;
_Tp* __ptr_;
const std::size_t __buf_size_;
__buffer(const __buffer&) = delete;
void
operator=(const __buffer&) = delete;
public:
__buffer(std::size_t __n) : __allocator_(), __ptr_(__allocator_.allocate(__n)), __buf_size_(__n) {}
operator bool() const { return __ptr_ != nullptr; }
_Tp*
get() const
{
return __ptr_;
}
~__buffer() { __allocator_.deallocate(__ptr_, __buf_size_); }
};
inline void
__cancel_execution()
{
}
template <class _ExecutionPolicy, class _Index, class _Fp>
void
__parallel_for(_ExecutionPolicy&&, _Index __first, _Index __last, _Fp __f)
{
__f(__first, __last);
}
template <class _ExecutionPolicy, class _Value, class _Index, typename _RealBody, typename _Reduction>
_Value
__parallel_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, const _Value& __identity,
const _RealBody& __real_body, const _Reduction&)
{
if (__first == __last)
{
return __identity;
}
else
{
return __real_body(__first, __last, __identity);
}
}
template <class _ExecutionPolicy, class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce>
_Tp
__parallel_transform_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, _UnaryOp, _Tp __init, _BinaryOp,
_Reduce __reduce)
{
return __reduce(__first, __last, __init);
}
template <class _ExecutionPolicy, typename _Index, typename _Tp, typename _Rp, typename _Cp, typename _Sp, typename _Ap>
void
__parallel_strict_scan(_ExecutionPolicy&&, _Index __n, _Tp __initial, _Rp __reduce, _Cp __combine, _Sp __scan,
_Ap __apex)
{
_Tp __sum = __initial;
if (__n)
__sum = __combine(__sum, __reduce(_Index(0), __n));
__apex(__sum);
if (__n)
__scan(_Index(0), __n, __initial);
}
template <class _ExecutionPolicy, class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce, class _Scan>
_Tp
__parallel_transform_scan(_ExecutionPolicy&&, _Index __n, _UnaryOp, _Tp __init, _BinaryOp, _Reduce, _Scan __scan)
{
return __scan(_Index(0), __n, __init);
}
template <class _ExecutionPolicy, typename _RandomAccessIterator, typename _Compare, typename _LeafSort>
void
__parallel_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
_LeafSort __leaf_sort, std::size_t = 0)
{
__leaf_sort(__first, __last, __comp);
}
template <class _ExecutionPolicy, typename _RandomAccessIterator1, typename _RandomAccessIterator2,
typename _RandomAccessIterator3, typename _Compare, typename _LeafMerge>
void
__parallel_merge(_ExecutionPolicy&&, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _RandomAccessIterator3 __out,
_Compare __comp, _LeafMerge __leaf_merge)
{
__leaf_merge(__first1, __last1, __first2, __last2, __out, __comp);
}
template <class _ExecutionPolicy, typename _F1, typename _F2>
void
__parallel_invoke(_ExecutionPolicy&&, _F1&& __f1, _F2&& __f2)
{
std::forward<_F1>(__f1)();
std::forward<_F2>(__f2)();
}
} // namespace __serial
} // namespace __pstl
namespace __pstl
{
namespace __par_backend
{
using namespace __pstl::__serial;
}
} // namespace __pstl
#endif /* _PSTL_PARALLEL_BACKEND_SERIAL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_parallel_backend_utils_H #ifndef _PSTL_PARALLEL_BACKEND_UTILS_H
#define __PSTL_parallel_backend_utils_H #define _PSTL_PARALLEL_BACKEND_UTILS_H
#include <iterator> #include <iterator>
#include <utility> #include <utility>
...@@ -53,7 +53,7 @@ struct __serial_move_merge ...@@ -53,7 +53,7 @@ struct __serial_move_merge
_RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp) _RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp)
{ {
auto __n = _M_nmerge; auto __n = _M_nmerge;
__PSTL_ASSERT(__n > 0); _PSTL_ASSERT(__n > 0);
if (__xs != __xe) if (__xs != __xe)
{ {
if (__ys != __ye) if (__ys != __ye)
...@@ -145,7 +145,7 @@ class __stack ...@@ -145,7 +145,7 @@ class __stack
~__stack() ~__stack()
{ {
__PSTL_ASSERT(size() <= _M_maxsize); _PSTL_ASSERT(size() <= _M_maxsize);
while (!empty()) while (!empty())
pop(); pop();
} }
...@@ -158,20 +158,20 @@ class __stack ...@@ -158,20 +158,20 @@ class __stack
size_t size_t
size() const size() const
{ {
__PSTL_ASSERT(_M_ptr - _M_buf.get() <= _M_maxsize); _PSTL_ASSERT(_M_ptr - _M_buf.get() <= _M_maxsize);
__PSTL_ASSERT(_M_ptr - _M_buf.get() >= 0); _PSTL_ASSERT(_M_ptr - _M_buf.get() >= 0);
return _M_ptr - _M_buf.get(); return _M_ptr - _M_buf.get();
} }
bool bool
empty() const empty() const
{ {
__PSTL_ASSERT(_M_ptr >= _M_buf.get()); _PSTL_ASSERT(_M_ptr >= _M_buf.get());
return _M_ptr == _M_buf.get(); return _M_ptr == _M_buf.get();
} }
void void
push(const _ValueType& __v) push(const _ValueType& __v)
{ {
__PSTL_ASSERT(size() < _M_maxsize); _PSTL_ASSERT(size() < _M_maxsize);
new (_M_ptr) _ValueType(__v); new (_M_ptr) _ValueType(__v);
++_M_ptr; ++_M_ptr;
} }
...@@ -183,7 +183,7 @@ class __stack ...@@ -183,7 +183,7 @@ class __stack
void void
pop() pop()
{ {
__PSTL_ASSERT(_M_ptr > _M_buf.get()); _PSTL_ASSERT(_M_ptr > _M_buf.get());
--_M_ptr; --_M_ptr;
(*_M_ptr).~_ValueType(); (*_M_ptr).~_ValueType();
} }
...@@ -192,4 +192,4 @@ class __stack ...@@ -192,4 +192,4 @@ class __stack
} // namespace __par_backend } // namespace __par_backend
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_parallel_backend_utils_H */ #endif /* _PSTL_PARALLEL_BACKEND_UTILS_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_parallel_impl_H #ifndef _PSTL_PARALLEL_IMPL_H
#define __PSTL_parallel_impl_H #define _PSTL_PARALLEL_IMPL_H
#include <atomic> #include <atomic>
// This header defines the minimum set of parallel routines required to support Parallel STL, // This header defines the minimum set of parallel routines required to support Parallel STL,
...@@ -78,4 +78,4 @@ __parallel_or(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick _ ...@@ -78,4 +78,4 @@ __parallel_or(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick _
} // namespace __internal } // namespace __internal
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_parallel_impl_H */ #endif /* _PSTL_PARALLEL_IMPL_H */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_utils_H #ifndef _PSTL_UTILS_H
#define __PSTL_utils_H #define _PSTL_UTILS_H
#include <new> #include <new>
#include <iterator> #include <iterator>
...@@ -219,4 +219,4 @@ __cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare _ ...@@ -219,4 +219,4 @@ __cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare _
} // namespace __internal } // namespace __internal
} // namespace __pstl } // namespace __pstl
#endif /* __PSTL_utils_H */ #endif /* _PSTL_UTILS_H */
...@@ -63,13 +63,13 @@ ...@@ -63,13 +63,13 @@
#if __cplusplus > 201402L #if __cplusplus > 201402L
// Parallel STL algorithms // Parallel STL algorithms
# if __PSTL_EXECUTION_POLICIES_DEFINED # if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations // If <execution> has already been included, pull in implementations
# include <pstl/glue_algorithm_impl.h> # include <pstl/glue_algorithm_impl.h>
# else # else
// Otherwise just pull in forward declarations // Otherwise just pull in forward declarations
# include <pstl/glue_algorithm_defs.h> # include <pstl/glue_algorithm_defs.h>
# define __PSTL_ALGORITHM_FORWARD_DECLARED 1 # define _PSTL_ALGORITHM_FORWARD_DECLARED 1
# endif # endif
// Feature test macro for parallel algorithms // Feature test macro for parallel algorithms
......
...@@ -31,20 +31,20 @@ ...@@ -31,20 +31,20 @@
# include <bits/c++config.h> # include <bits/c++config.h>
# include <pstl/glue_execution_defs.h> # include <pstl/glue_execution_defs.h>
# define __PSTL_EXECUTION_POLICIES_DEFINED 1 # define _PSTL_EXECUTION_POLICIES_DEFINED 1
// Algorithm implementation // Algorithm implementation
# if __PSTL_ALGORITHM_FORWARD_DECLARED # if _PSTL_ALGORITHM_FORWARD_DECLARED
# include <pstl/glue_algorithm_impl.h> # include <pstl/glue_algorithm_impl.h>
# endif # endif
// Numeric implementation // Numeric implementation
# if __PSTL_NUMERIC_FORWARD_DECLARED # if _PSTL_NUMERIC_FORWARD_DECLARED
# include <pstl/glue_numeric_impl.h> # include <pstl/glue_numeric_impl.h>
# endif # endif
// Memory implementation // Memory implementation
# if __PSTL_NUMERIC_FORWARD_DECLARED # if _PSTL_NUMERIC_FORWARD_DECLARED
# include <pstl/glue_memory_impl.h> # include <pstl/glue_memory_impl.h>
# endif # endif
......
...@@ -398,7 +398,7 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -398,7 +398,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
#if __cplusplus > 201402L #if __cplusplus > 201402L
// Parallel STL algorithms // Parallel STL algorithms
# if __PSTL_EXECUTION_POLICIES_DEFINED # if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations // If <execution> has already been included, pull in implementations
# include <pstl/glue_memory_impl.h> # include <pstl/glue_memory_impl.h>
# else # else
......
...@@ -206,13 +206,13 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -206,13 +206,13 @@ _GLIBCXX_END_NAMESPACE_VERSION
#if __cplusplus > 201402L #if __cplusplus > 201402L
// Parallel STL algorithms // Parallel STL algorithms
# if __PSTL_EXECUTION_POLICIES_DEFINED # if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations // If <execution> has already been included, pull in implementations
# include <pstl/glue_numeric_impl.h> # include <pstl/glue_numeric_impl.h>
# else # else
// Otherwise just pull in forward declarations // Otherwise just pull in forward declarations
# include <pstl/glue_numeric_defs.h> # include <pstl/glue_numeric_defs.h>
# define __PSTL_NUMERIC_FORWARD_DECLARED 1 # define _PSTL_NUMERIC_FORWARD_DECLARED 1
# endif # endif
// Feature test macro for parallel algorithms // Feature test macro for parallel algorithms
......
...@@ -116,7 +116,7 @@ main() ...@@ -116,7 +116,7 @@ main()
{ {
// for user-defined types // for user-defined types
#if !__PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN #if !_PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN
test_uninit_construct_by_type<Wrapper<int32_t>>(); test_uninit_construct_by_type<Wrapper<int32_t>>();
test_uninit_construct_by_type<Wrapper<std::vector<std::string>>>(); test_uninit_construct_by_type<Wrapper<std::vector<std::string>>>();
#endif #endif
......
...@@ -80,7 +80,7 @@ struct test_uninitialized_copy_move ...@@ -80,7 +80,7 @@ struct test_uninitialized_copy_move
std::destroy_n(exec, out_first, n); std::destroy_n(exec, out_first, n);
} }
#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
template <typename InputIterator, typename OutputIterator> template <typename InputIterator, typename OutputIterator>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -142,8 +142,8 @@ main() ...@@ -142,8 +142,8 @@ main()
test_uninitialized_copy_move_by_type<float64_t>(); test_uninitialized_copy_move_by_type<float64_t>();
// for user-defined types // 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 !_PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN
test_uninitialized_copy_move_by_type<Wrapper<int8_t>>(); test_uninitialized_copy_move_by_type<Wrapper<int8_t>>();
#endif #endif
......
...@@ -29,8 +29,8 @@ using namespace TestUtils; ...@@ -29,8 +29,8 @@ using namespace TestUtils;
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 specialization by policy type, in case of broken configuration _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> template <typename BiDirIt1, typename Size, typename Generator1, typename Generator2, typename Compare>
void void
operator()(pstl::execution::unsequenced_policy, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2, operator()(pstl::execution::unsequenced_policy, BiDirIt1 first1, BiDirIt1 last1, BiDirIt1 first2, BiDirIt1 last2,
......
...@@ -111,7 +111,7 @@ main() ...@@ -111,7 +111,7 @@ main()
test_merge_by_type<int32_t>([](size_t v) { return (v % 2 == 0 ? v : -v) * 3; }, [](size_t v) { return v * 2; }); test_merge_by_type<int32_t>([](size_t v) { return (v % 2 == 0 ? v : -v) * 3; }, [](size_t v) { return v * 2; });
test_merge_by_type<float64_t>([](size_t v) { return float64_t(v); }, [](size_t v) { return float64_t(v - 100); }); test_merge_by_type<float64_t>([](size_t v) { return float64_t(v); }, [](size_t v) { return float64_t(v - 100); });
#if !__PSTL_ICC_16_17_TEST_64_TIMEOUT #if !_PSTL_ICC_16_17_TEST_64_TIMEOUT
test_merge_by_type<Wrapper<int16_t>>([](size_t v) { return Wrapper<int16_t>(v % 100); }, test_merge_by_type<Wrapper<int16_t>>([](size_t v) { return Wrapper<int16_t>(v % 100); },
[](size_t v) { return Wrapper<int16_t>(v % 10); }); [](size_t v) { return Wrapper<int16_t>(v % 10); });
#endif #endif
......
...@@ -28,7 +28,7 @@ using namespace TestUtils; ...@@ -28,7 +28,7 @@ using namespace TestUtils;
struct run_copy_if struct run_copy_if
{ {
#if __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN // dummy specializations to skip testing in case of broken configuration #if _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN // dummy specializations to skip testing in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size, template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size,
typename Predicate, typename T> typename Predicate, typename T>
void void
...@@ -139,11 +139,11 @@ main() ...@@ -139,11 +139,11 @@ main()
test<int32_t>(-666, [](const int32_t& x) { return x != 42; }, test<int32_t>(-666, [](const int32_t& x) { return x != 42; },
[](size_t j) { return ((j + 1) % 5 & 2) != 0 ? int32_t(j + 1) : 42; }); [](size_t j) { return ((j + 1) % 5 & 2) != 0 ? int32_t(j + 1) : 42; });
#if !__PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN #if !_PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN
test<Number>(Number(42, OddTag()), IsMultiple(3, OddTag()), [](int32_t j) { return Number(j, OddTag()); }); test<Number>(Number(42, OddTag()), IsMultiple(3, OddTag()), [](int32_t j) { return Number(j, OddTag()); });
#endif #endif
#if !__PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
test<int32_t>(-666, [](const int32_t& x) { return true; }, [](size_t j) { return j; }, false); test<int32_t>(-666, [](const int32_t& x) { return true; }, [](size_t j) { return j; }, false);
#endif #endif
......
...@@ -30,8 +30,8 @@ using namespace TestUtils; ...@@ -30,8 +30,8 @@ using namespace TestUtils;
struct run_copy 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 _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> template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size, typename T>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -83,8 +83,8 @@ template <typename T> ...@@ -83,8 +83,8 @@ template <typename T>
struct run_move 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 _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> template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -126,8 +126,8 @@ template <typename T> ...@@ -126,8 +126,8 @@ template <typename T>
struct run_move<Wrapper<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 _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> template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -199,7 +199,7 @@ main() ...@@ -199,7 +199,7 @@ main()
test<int32_t>(-666, [](size_t j) { return int32_t(j); }); test<int32_t>(-666, [](size_t j) { return int32_t(j); });
test<Wrapper<float64_t>>(Wrapper<float64_t>(-666.0), [](int32_t j) { return Wrapper<float64_t>(j); }); test<Wrapper<float64_t>>(Wrapper<float64_t>(-666.0), [](int32_t j) { return Wrapper<float64_t>(j); });
#if !__PSTL_ICC_16_17_TEST_64_TIMEOUT #if !_PSTL_ICC_16_17_TEST_64_TIMEOUT
test<float64_t>(-666.0, [](size_t j) { return float64_t(j); }); test<float64_t>(-666.0, [](size_t j) { return float64_t(j); });
test<Number>(Number(42, OddTag()), [](int32_t j) { return Number(j, OddTag()); }); test<Number>(Number(42, OddTag()), [](int32_t j) { return Number(j, OddTag()); });
#endif #endif
......
...@@ -28,7 +28,7 @@ using namespace TestUtils; ...@@ -28,7 +28,7 @@ using namespace TestUtils;
struct test_one_policy struct test_one_policy
{ {
//dummy specialization by policy type, in case of broken configuration //dummy specialization by policy type, in case of broken configuration
#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
template <typename Iterator1, typename Predicate> template <typename Iterator1, typename Predicate>
void void
...@@ -97,7 +97,7 @@ main() ...@@ -97,7 +97,7 @@ main()
test<float64_t>([](const float64_t x) { return x < 0; }); test<float64_t>([](const float64_t x) { return x < 0; });
test<int32_t>([](const int32_t x) { return x > 1000; }); test<int32_t>([](const int32_t x) { return x > 1000; });
test<uint16_t>([](const uint16_t x) { return x % 5 < 3; }); test<uint16_t>([](const uint16_t x) { return x % 5 < 3; });
#if !__PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN && !__PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN && !_PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN
test<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>& x) { return true; }); test<LocalWrapper<float64_t>>([](const LocalWrapper<float64_t>& x) { return true; });
#endif #endif
......
...@@ -72,8 +72,8 @@ is_equal(Iterator first, Iterator last, Iterator d_first) ...@@ -72,8 +72,8 @@ is_equal(Iterator first, Iterator last, Iterator d_first)
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,
...@@ -87,7 +87,7 @@ struct test_one_policy ...@@ -87,7 +87,7 @@ struct test_one_policy
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,
...@@ -172,7 +172,7 @@ struct test_non_const ...@@ -172,7 +172,7 @@ struct test_non_const
int32_t int32_t
main() main()
{ {
#if !__PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
test_by_type<int32_t>([](int32_t i) { return i; }, [](int32_t) { return true; }); test_by_type<int32_t>([](int32_t i) { return i; }, [](int32_t) { return true; });
#endif #endif
test_by_type<float64_t>([](int32_t i) { return -i; }, [](const float64_t x) { return x < 0; }); test_by_type<float64_t>([](int32_t i) { return -i; }, [](const float64_t x) { return x < 0; });
......
...@@ -48,7 +48,7 @@ struct test_partition_copy ...@@ -48,7 +48,7 @@ struct test_partition_copy
} }
//dummy specialization by iterator type and policy type, in case of broken configuration //dummy specialization by iterator type and policy type, in case of broken configuration
#if __PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN #if _PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename UnaryOp> template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename UnaryOp>
void void
operator()(pstl::execution::unsequenced_policy, std::reverse_iterator<InputIterator> first, operator()(pstl::execution::unsequenced_policy, std::reverse_iterator<InputIterator> first,
...@@ -110,7 +110,7 @@ main() ...@@ -110,7 +110,7 @@ main()
{ {
test<int32_t>([](const int32_t value) { return value % 2; }); test<int32_t>([](const int32_t value) { return value % 2; });
#if !__PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
test<int32_t>([](const int32_t value) { return true; }); test<int32_t>([](const int32_t value) { return true; });
#endif #endif
......
...@@ -28,8 +28,8 @@ using namespace TestUtils; ...@@ -28,8 +28,8 @@ using namespace TestUtils;
struct run_remove 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 _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> template <typename InputIterator, typename OutputIterator, typename Size, typename T>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -66,8 +66,8 @@ struct run_remove ...@@ -66,8 +66,8 @@ struct run_remove
struct run_remove_if 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 _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> template <typename InputIterator, typename OutputIterator, typename Size, typename Predicate>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, OutputIterator out_first,
...@@ -140,7 +140,7 @@ struct test_non_const ...@@ -140,7 +140,7 @@ struct test_non_const
int32_t int32_t
main() main()
{ {
#if !__PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN #if !_PSTL_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN
test<int32_t>(666, 42, [](int32_t val) { return true; }, [](size_t j) { return j; }); test<int32_t>(666, 42, [](int32_t val) { return true; }, [](size_t j) { return j; });
#endif #endif
...@@ -149,7 +149,7 @@ main() ...@@ -149,7 +149,7 @@ main()
test<float64_t>(-666.0, 8.5, [](const float64_t& val) { return val != 8.5; }, test<float64_t>(-666.0, 8.5, [](const float64_t& val) { return val != 8.5; },
[](size_t j) { return ((j + 1) % 7 & 2) != 0 ? 8.5 : float64_t(j % 32 + j); }); [](size_t j) { return ((j + 1) % 7 & 2) != 0 ? 8.5 : float64_t(j % 32 + j); });
#if !__PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN #if !_PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN
test<Number>(Number(-666, OddTag()), Number(42, OddTag()), IsMultiple(3, OddTag()), test<Number>(Number(-666, OddTag()), Number(42, OddTag()), IsMultiple(3, OddTag()),
[](int32_t j) { return Number(j, OddTag()); }); [](int32_t j) { return Number(j, OddTag()); });
#endif #endif
......
...@@ -100,7 +100,7 @@ main() ...@@ -100,7 +100,7 @@ main()
test<int32_t>(-666, 42, 99, [](const int32_t& x) { return x != 42; }, test<int32_t>(-666, 42, 99, [](const int32_t& x) { return x != 42; },
[](size_t j) { return ((j + 1) % 5 & 2) != 0 ? 42 : -1 - int32_t(j); }); [](size_t j) { return ((j + 1) % 5 & 2) != 0 ? 42 : -1 - int32_t(j); });
#if !__PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN #if !_PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN
test<Number>(Number(42, OddTag()), Number(2001, OddTag()), Number(2017, OddTag()), IsMultiple(3, OddTag()), test<Number>(Number(42, OddTag()), Number(2001, OddTag()), Number(2017, OddTag()), IsMultiple(3, OddTag()),
[](int32_t j) { return ((j + 1) % 3 & 2) != 0 ? Number(2001, OddTag()) : Number(j, OddTag()); }); [](int32_t j) { return ((j + 1) % 3 & 2) != 0 ? Number(2001, OddTag()) : Number(j, OddTag()); });
#endif #endif
......
...@@ -82,8 +82,8 @@ struct compare<wrapper<T>> ...@@ -82,8 +82,8 @@ struct compare<wrapper<T>>
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 Iterator, typename Size> template <typename Iterator, typename Size>
void void
operator()(__pstl::execution::unsequenced_policy, Iterator data_b, Iterator data_e, Iterator actual_b, operator()(__pstl::execution::unsequenced_policy, Iterator data_b, Iterator data_e, Iterator actual_b,
......
...@@ -77,8 +77,8 @@ struct comparator ...@@ -77,8 +77,8 @@ struct comparator
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 specialization by policy type, in case of broken configuration _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> template <typename Iterator1, typename Iterator2>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b, operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b,
......
...@@ -28,8 +28,8 @@ using namespace TestUtils; ...@@ -28,8 +28,8 @@ using namespace TestUtils;
struct run_unique 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 _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> template <typename ForwardIt, typename Generator>
void void
operator()(pstl::execution::unsequenced_policy, ForwardIt first1, ForwardIt last1, ForwardIt first2, operator()(pstl::execution::unsequenced_policy, ForwardIt first1, ForwardIt last1, ForwardIt first2,
...@@ -146,7 +146,7 @@ struct test_non_const ...@@ -146,7 +146,7 @@ struct test_non_const
int32_t int32_t
main() main()
{ {
#if !__PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN #if !_PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN
test<int32_t>([](size_t j) { return j / 3; }, test<int32_t>([](size_t j) { return j / 3; },
[](const int32_t& val1, const int32_t& val2) { return val1 * val1 == val2 * val2; }); [](const int32_t& val1, const int32_t& val2) { return val1 * val1 == val2 * val2; });
test<float64_t>([](size_t) { return float64_t(1); }, test<float64_t>([](size_t) { return float64_t(1); },
......
...@@ -28,7 +28,7 @@ using namespace TestUtils; ...@@ -28,7 +28,7 @@ using namespace TestUtils;
struct run_unique_copy struct run_unique_copy
{ {
#if __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN // dummy specializations to skip testing in case of broken configuration #if _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN // dummy specializations to skip testing in case of broken configuration
template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size, template <typename InputIterator, typename OutputIterator, typename OutputIterator2, typename Size,
typename Predicate, typename T> typename Predicate, typename T>
void void
...@@ -130,7 +130,7 @@ main(int32_t argc, char* argv[]) ...@@ -130,7 +130,7 @@ main(int32_t argc, char* argv[])
test<float32_t>(float32_t(42), std::equal_to<float32_t>(), test<float32_t>(float32_t(42), std::equal_to<float32_t>(),
[](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); }); [](int32_t j) { return float32_t(5 * j / 23 ^ (j / 7)); });
#if !__PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
test<float32_t>(float32_t(42), [](float32_t x, float32_t y) { return false; }, test<float32_t>(float32_t(42), [](float32_t x, float32_t y) { return false; },
[](int32_t j) { return float32_t(j); }, false); [](int32_t j) { return float32_t(j); }, false);
#endif #endif
......
...@@ -113,7 +113,7 @@ main() ...@@ -113,7 +113,7 @@ main()
test<int32_t>(8 * sizeof(int32_t)); test<int32_t>(8 * sizeof(int32_t));
test<uint16_t>(8 * sizeof(uint16_t)); test<uint16_t>(8 * sizeof(uint16_t));
test<float64_t>(53); test<float64_t>(53);
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(1); test<bool>(1);
#endif #endif
......
...@@ -99,7 +99,7 @@ main() ...@@ -99,7 +99,7 @@ main()
test<int32_t>(8 * sizeof(int32_t)); test<int32_t>(8 * sizeof(int32_t));
test<uint16_t>(8 * sizeof(uint16_t)); test<uint16_t>(8 * sizeof(uint16_t));
test<float64_t>(53); test<float64_t>(53);
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(1); test<bool>(1);
#endif #endif
......
...@@ -101,7 +101,7 @@ int32_t ...@@ -101,7 +101,7 @@ int32_t
main() main()
{ {
test<int32_t>(42, IsEqual<int32_t>(50, OddTag()), [](int32_t j) { return j; }); test<int32_t>(42, IsEqual<int32_t>(50, OddTag()), [](int32_t j) { return j; });
#if !__PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN
test<int32_t>(42, [](const int32_t& x) { return true; }, [](int32_t j) { return j; }); test<int32_t>(42, [](const int32_t& x) { return true; }, [](int32_t j) { return j; });
#endif #endif
test<float64_t>(42, IsEqual<float64_t>(50, OddTag()), [](int32_t j) { return float64_t(j); }); test<float64_t>(42, IsEqual<float64_t>(50, OddTag()), [](int32_t j) { return float64_t(j); });
......
...@@ -163,7 +163,7 @@ main() ...@@ -163,7 +163,7 @@ main()
test<int32_t>(8 * sizeof(int32_t)); test<int32_t>(8 * sizeof(int32_t));
test<uint16_t>(8 * sizeof(uint16_t)); test<uint16_t>(8 * sizeof(uint16_t));
test<float64_t>(53); test<float64_t>(53);
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(1); test<bool>(1);
#endif #endif
test<UserType>(256); test<UserType>(256);
......
...@@ -28,8 +28,8 @@ using namespace TestUtils; ...@@ -28,8 +28,8 @@ using namespace TestUtils;
struct test_find 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 _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> template <typename Iterator, typename Value>
void void
operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Value value) operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Value value)
......
...@@ -27,8 +27,8 @@ using namespace TestUtils; ...@@ -27,8 +27,8 @@ using namespace TestUtils;
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 specialization by policy type, in case of broken configuration _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> template <typename Iterator1, typename Iterator2, typename Predicate>
void void
operator()(pstl::execution::unsequenced_policy, Iterator1 b, Iterator1 e, Iterator2 bsub, Iterator2 esub, operator()(pstl::execution::unsequenced_policy, Iterator1 b, Iterator1 e, Iterator2 bsub, Iterator2 esub,
...@@ -119,7 +119,7 @@ main() ...@@ -119,7 +119,7 @@ main()
test<int32_t>(8 * sizeof(int32_t)); test<int32_t>(8 * sizeof(int32_t));
test<uint16_t>(8 * sizeof(uint16_t)); test<uint16_t>(8 * sizeof(uint16_t));
test<float64_t>(53); test<float64_t>(53);
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(1); test<bool>(1);
#endif #endif
......
...@@ -27,8 +27,8 @@ using namespace TestUtils; ...@@ -27,8 +27,8 @@ using namespace TestUtils;
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 specialization by policy type, in case of broken configuration _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> template <typename Iterator1, typename Iterator2, typename Predicate>
void void
operator()(pstl::execution::unsequenced_policy, Iterator1 b, Iterator1 e, Iterator2 bsub, Iterator2 esub, operator()(pstl::execution::unsequenced_policy, Iterator1 b, Iterator1 e, Iterator2 bsub, Iterator2 esub,
......
...@@ -28,8 +28,8 @@ using namespace TestUtils; ...@@ -28,8 +28,8 @@ using namespace TestUtils;
struct test_find_if 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 _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> template <typename Iterator, typename Predicate, typename NotPredicate>
void void
operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Predicate pred, operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Predicate pred,
...@@ -99,7 +99,7 @@ struct test_non_const ...@@ -99,7 +99,7 @@ struct test_non_const
int32_t int32_t
main() main()
{ {
#if !__PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN #if !_PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN
// Note that the "hit" and "miss" functions here avoid overflow issues. // Note that the "hit" and "miss" functions here avoid overflow issues.
test<Number>(IsMultiple(5, OddTag()), [](int32_t j) { return Number(j - j % 5, OddTag()); }, // hit test<Number>(IsMultiple(5, OddTag()), [](int32_t j) { return Number(j - j % 5, OddTag()); }, // hit
[](int32_t j) { return Number(j % 5 == 0 ? j ^ 1 : j, OddTag()); }); // miss [](int32_t j) { return Number(j % 5 == 0 ? j ^ 1 : j, OddTag()); }); // miss
......
...@@ -97,7 +97,7 @@ main() ...@@ -97,7 +97,7 @@ main()
test<int32_t>(8 * sizeof(int32_t)); test<int32_t>(8 * sizeof(int32_t));
test<uint16_t>(8 * sizeof(uint16_t)); test<uint16_t>(8 * sizeof(uint16_t));
test<float64_t>(53); test<float64_t>(53);
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(1); test<bool>(1);
#endif #endif
......
...@@ -77,8 +77,8 @@ is_equal(const T& x, const T& y) ...@@ -77,8 +77,8 @@ is_equal(const T& x, const T& y)
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 specialization by policy type, in case of broken configuration _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> 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 typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator1 first1, Iterator1 last1, Iterator1 first2, operator()(pstl::execution::unsequenced_policy, Iterator1 first1, Iterator1 last1, Iterator1 first2,
......
...@@ -29,8 +29,8 @@ using namespace TestUtils; ...@@ -29,8 +29,8 @@ using namespace TestUtils;
struct test_one_policy 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 _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> template <typename Iterator1, typename Iterator2>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b, operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b,
...@@ -103,7 +103,7 @@ main() ...@@ -103,7 +103,7 @@ main()
test<int32_t>(); test<int32_t>();
test<uint16_t>(); test<uint16_t>();
test<float64_t>(); test<float64_t>();
#if !__PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN #if !_PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN
test<wrapper<float64_t>>(); test<wrapper<float64_t>>();
#endif #endif
......
...@@ -69,8 +69,8 @@ struct test_one_policy ...@@ -69,8 +69,8 @@ struct test_one_policy
Iterator data_e; Iterator data_e;
test_one_policy(Iterator b, Iterator e) : data_b(b), data_e(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 _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN // dummy specialization by policy type, in case of broken configuration
template <typename Iterator1> template <typename Iterator1>
typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator1 actual_b, Iterator1 actual_e) operator()(pstl::execution::unsequenced_policy, Iterator1 actual_b, Iterator1 actual_e)
......
...@@ -27,8 +27,8 @@ using namespace TestUtils; ...@@ -27,8 +27,8 @@ using namespace TestUtils;
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 specialization by policy type, in case of broken configuration _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> template <typename Iterator, typename Size, typename T, typename Predicate>
void void
operator()(pstl::execution::unsequenced_policy, Iterator b, Iterator e, Size count, const T& value, Predicate pred) operator()(pstl::execution::unsequenced_policy, Iterator b, Iterator e, Size count, const T& value, Predicate pred)
...@@ -105,7 +105,7 @@ main() ...@@ -105,7 +105,7 @@ main()
test<int32_t>(); test<int32_t>();
test<uint16_t>(); test<uint16_t>();
test<float64_t>(); test<float64_t>();
#if !__PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN #if !_PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN
test<bool>(); test<bool>();
#endif #endif
......
...@@ -42,8 +42,8 @@ struct WithCmpOp ...@@ -42,8 +42,8 @@ struct WithCmpOp
struct test_is_heap 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 _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> template <typename Iterator, typename Predicate>
typename std::enable_if<is_same_iterator_category<Iterator, std::random_access_iterator_tag>::value, void>::type typename std::enable_if<is_same_iterator_category<Iterator, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Predicate pred) operator()(pstl::execution::unsequenced_policy, Iterator first, Iterator last, Predicate pred)
......
...@@ -169,7 +169,7 @@ main() ...@@ -169,7 +169,7 @@ main()
{ {
test<uint16_t, float64_t>(std::less<float64_t>()); test<uint16_t, float64_t>(std::less<float64_t>());
test<float32_t, int32_t>(std::greater<float32_t>()); test<float32_t, int32_t>(std::greater<float32_t>());
#if !__PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN #if !_PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN
test<float64_t, int32_t>([](const float64_t x, const int32_t y) { return x * x < y * y; }); test<float64_t, int32_t>([](const float64_t x, const int32_t y) { return x * x < y * y; });
#endif #endif
test<LocalWrapper<int32_t>, LocalWrapper<int32_t>>( test<LocalWrapper<int32_t>, LocalWrapper<int32_t>>(
......
...@@ -90,7 +90,7 @@ struct test_brick_partial_sort ...@@ -90,7 +90,7 @@ struct test_brick_partial_sort
if (m1 - first > 1) if (m1 - first > 1)
{ {
auto complex = std::ceil(n * std::log(float32_t(m1 - first))); auto complex = std::ceil(n * std::log(float32_t(m1 - first)));
#if __PSTL_USE_PAR_POLICIES #if _PSTL_USE_PAR_POLICIES
auto p = tbb::this_task_arena::max_concurrency(); auto p = tbb::this_task_arena::max_concurrency();
#else #else
auto p = 1; auto p = 1;
......
...@@ -63,8 +63,8 @@ struct test_one_policy ...@@ -63,8 +63,8 @@ struct test_one_policy
: d_first(b1), d_last(e1), exp_first(b2), exp_last(e2) : 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 _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> template <typename InputIterator, typename Size, typename T, typename Compare>
void void
operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, Size n1, Size n2, operator()(pstl::execution::unsequenced_policy, InputIterator first, InputIterator last, Size n1, Size n2,
......
...@@ -101,8 +101,8 @@ compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Functio ...@@ -101,8 +101,8 @@ compute_and_check(Iterator1 first, Iterator1 last, Iterator2 d_first, T, Functio
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 specialization by policy type, in case of broken configuration _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> 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 typename std::enable_if<is_same_iterator_category<Iterator1, std::random_access_iterator_tag>::value, void>::type
operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b, operator()(pstl::execution::unsequenced_policy, Iterator1 data_b, Iterator1 data_e, Iterator2 actual_b,
......
...@@ -61,7 +61,7 @@ test_long_form(T init, BinaryOp binary_op, F f) ...@@ -61,7 +61,7 @@ test_long_form(T init, BinaryOp binary_op, F f)
struct test_two_short_forms struct test_two_short_forms
{ {
#if __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN //dummy specialization by policy type, in case of broken configuration #if _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN //dummy specialization by policy type, in case of broken configuration
template <typename Iterator> template <typename Iterator>
void void
operator()(__pstl::execution::parallel_policy, Iterator first, Iterator last, Sum init, Sum expected) operator()(__pstl::execution::parallel_policy, Iterator first, Iterator last, Sum init, Sum expected)
......
...@@ -191,7 +191,7 @@ main() ...@@ -191,7 +191,7 @@ main()
for (int32_t mode = 0; mode < 2; ++mode) for (int32_t mode = 0; mode < 2; ++mode)
{ {
inclusive = mode != 0; inclusive = mode != 0;
#if !__PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN #if !_PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN
// Test with highly restricted type and associative but not commutative operation // Test with highly restricted type and associative but not commutative operation
test_matrix<Matrix2x2<int32_t>, Matrix2x2<int32_t>>(Matrix2x2<int32_t>(), multiply_matrix<int32_t>, test_matrix<Matrix2x2<int32_t>, Matrix2x2<int32_t>>(Matrix2x2<int32_t>(), multiply_matrix<int32_t>,
Matrix2x2<int32_t>(-666, 666)); Matrix2x2<int32_t>(-666, 666));
......
...@@ -172,7 +172,7 @@ main() ...@@ -172,7 +172,7 @@ main()
for (int32_t mode = 0; mode < 2; ++mode) for (int32_t mode = 0; mode < 2; ++mode)
{ {
inclusive = mode != 0; inclusive = mode != 0;
#if !__PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN #if !_PSTL_ICC_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN
test_matrix<Matrix2x2<int32_t>, Matrix2x2<int32_t>>([](const Matrix2x2<int32_t> x) { return x; }, test_matrix<Matrix2x2<int32_t>, Matrix2x2<int32_t>>([](const Matrix2x2<int32_t> x) { return x; },
Matrix2x2<int32_t>(), multiply_matrix<int32_t>, Matrix2x2<int32_t>(), multiply_matrix<int32_t>,
Matrix2x2<int32_t>(-666, 666)); Matrix2x2<int32_t>(-666, 666));
......
...@@ -7,43 +7,43 @@ ...@@ -7,43 +7,43 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __PSTL_TEST_config_H #ifndef _PSTL_TEST_CONFIG_H
#define __PSTL_TEST_config_H #define _PSTL_TEST_CONFIG_H
#if defined(_MSC_VER) && defined(_DEBUG) #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 #endif
#define __PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN \ #define _PSTL_ICC_16_17_TEST_REDUCTION_BOOL_TYPE_RELEASE_64_BROKEN \
(__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER <= 1700 && !__APPLE__) (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER <= 1700 && !__APPLE__)
#define __PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN \ #define _PSTL_ICC_16_17_TEST_REDUCTION_RELEASE_BROKEN \
(!_DEBUG && __INTEL_COMPILER && \ (!_DEBUG && __INTEL_COMPILER && \
(__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1))) (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)))
#define __PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN \ #define _PSTL_ICC_1800_TEST_MONOTONIC_RELEASE_64_BROKEN \
(__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1) (__x86_64 && !_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 1)
#define __PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN \ #define _PSTL_ICC_17_TEST_MAC_RELEASE_32_BROKEN \
(__i386__ && !_DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && __APPLE__) (__i386__ && !_DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && __APPLE__)
#define __PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN \ #define _PSTL_ICC_18_VC141_TEST_SIMD_LAMBDA_RELEASE_BROKEN \
(!_DEBUG && __INTEL_COMPILER >= 1800 && __INTEL_COMPILER < 1900 && _MSC_VER == 1910) (!_DEBUG && __INTEL_COMPILER >= 1800 && __INTEL_COMPILER < 1900 && _MSC_VER == 1910)
#define __PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \ #define _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
(_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && _MSC_VER >= 1900) (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1700 && __INTEL_COMPILER < 1800 && _MSC_VER >= 1900)
#define __PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \ #define _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN \
(_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1600 && __INTEL_COMPILER < 1700 && _MSC_VER == 1900) (_M_IX86 && _DEBUG && __INTEL_COMPILER >= 1600 && __INTEL_COMPILER < 1700 && _MSC_VER == 1900)
#define __PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN \ #define _PSTL_ICC_16_VC14_TEST_PAR_TBB_RT_RELEASE_64_BROKEN \
(__PSTL_USE_PAR_POLICIES && ((_M_X64 && _MSC_VER == 1900) || __x86_64) && !_DEBUG && __INTEL_COMPILER < 1700) (_PSTL_USE_PAR_POLICIES && ((_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_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_ICC_18_TEST_EARLY_EXIT_MONOTONIC_RELEASE_BROKEN (!_DEBUG && __INTEL_COMPILER && __INTEL_COMPILER == 1800)
#define __PSTL_CLANG_TEST_BIG_OBJ_DEBUG_32_BROKEN \ #define _PSTL_CLANG_TEST_BIG_OBJ_DEBUG_32_BROKEN \
(__i386__ && PSTL_USE_DEBUG && __clang__ && __PSTL_CLANG_VERSION <= 90000) (__i386__ && PSTL_USE_DEBUG && __clang__ && _PSTL_CLANG_VERSION <= 90000)
#define __PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN \ #define _PSTL_ICC_16_17_18_TEST_UNIQUE_MASK_RELEASE_BROKEN \
(!_DEBUG && __INTEL_COMPILER && \ (!_DEBUG && __INTEL_COMPILER && \
(__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 3))) (__INTEL_COMPILER < 1800 || (__INTEL_COMPILER == 1800 && __INTEL_COMPILER_UPDATE < 3)))
#define __PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN \ #define _PSTL_ICC_18_TEST_EARLY_EXIT_AVX_RELEASE_BROKEN \
(!_DEBUG && __INTEL_COMPILER == 1800 && __AVX__ && !__AVX2__ && !__AVX512__) (!_DEBUG && __INTEL_COMPILER == 1800 && __AVX__ && !__AVX2__ && !__AVX512__)
#define __PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN \ #define _PSTL_ICC_19_TEST_IS_PARTITIONED_RELEASE_BROKEN \
(!PSTL_USE_DEBUG && (__linux__ || __APPLE__) && __INTEL_COMPILER == 1900) (!PSTL_USE_DEBUG && (__linux__ || __APPLE__) && __INTEL_COMPILER == 1900)
#define __PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN \ #define _PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN \
(__INTEL_COMPILER == 1900 && _MSC_VER >= 1900 && _MSC_VER <= 1910) (__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_19_TEST_SIMD_UDS_WINDOWS_RELEASE_BROKEN (__INTEL_COMPILER == 1900 && _MSC_VER && !_DEBUG)
#endif /* __PSTL_TEST_config_H */ #endif /* _PSTL_TEST_CONFIG_H */
...@@ -10,14 +10,15 @@ ...@@ -10,14 +10,15 @@
// File contains common utilities that tests rely on // File contains common utilities that tests rely on
// Do not #include <algorithm>, because if we do we will not detect accidental dependencies. // Do not #include <algorithm>, because if we do we will not detect accidental dependencies.
#include <sstream> #include <atomic>
#include <iostream> #include <cstdint>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream>
#include <iterator> #include <iterator>
#include <vector>
#include <atomic>
#include <memory> #include <memory>
#include <cstdint> #include <sstream>
#include <vector>
#include "pstl_test_config.h" #include "pstl_test_config.h"
...@@ -38,32 +39,30 @@ template <typename T> ...@@ -38,32 +39,30 @@ template <typename T>
class Sequence; class Sequence;
// Handy macros for error reporting // Handy macros for error reporting
#define EXPECT_TRUE(condition, message) TestUtils::expect<true>(condition, __FILE__, __LINE__, message) #define EXPECT_TRUE(condition, message) ::TestUtils::expect(true, condition, __FILE__, __LINE__, message)
#define EXPECT_FALSE(condition, message) TestUtils::expect<false>(condition, __FILE__, __LINE__, message) #define EXPECT_FALSE(condition, message) ::TestUtils::expect(false, condition, __FILE__, __LINE__, message)
// Check that expected and actual are equal and have the same type. // Check that expected and actual are equal and have the same type.
#define EXPECT_EQ(expected, actual, message) TestUtils::expect_equal(expected, actual, __FILE__, __LINE__, message) #define EXPECT_EQ(expected, actual, message) ::TestUtils::expect_equal(expected, actual, __FILE__, __LINE__, message)
// Check that sequences started with expected and actual and have had size n are equal and have the same type. // Check that sequences started with expected and actual and have had size n are equal and have the same type.
#define EXPECT_EQ_N(expected, actual, n, message) \ #define EXPECT_EQ_N(expected, actual, n, message) \
TestUtils::expect_equal(expected, actual, n, __FILE__, __LINE__, message) ::TestUtils::expect_equal(expected, actual, n, __FILE__, __LINE__, message)
// Issue error message from outstr, adding a newline. // Issue error message from outstr, adding a newline.
// Real purpose of this routine is to have a place to hang a breakpoint. // Real purpose of this routine is to have a place to hang a breakpoint.
static void inline void
issue_error_message(std::stringstream& outstr) issue_error_message(std::stringstream& outstr)
{ {
outstr << std::endl; outstr << std::endl;
std::cerr << outstr.str(); std::cerr << outstr.str();
std::exit(EXIT_FAILURE);
} }
template <bool B> inline void
void expect(bool expected, bool condition, const char* file, int32_t line, const char* message)
expect(bool condition, const char* file, int32_t line, const char* message)
{ {
// Templating this function is somewhat silly, but avoids the need to declare it static if (condition != expected)
// or have a separate translation unit.
if (condition != B)
{ {
std::stringstream outstr; std::stringstream outstr;
outstr << "error at " << file << ":" << line << " - " << message; outstr << "error at " << file << ":" << line << " - " << message;
...@@ -573,7 +572,7 @@ struct Matrix2x2 ...@@ -573,7 +572,7 @@ struct Matrix2x2
T a[2][2]; T a[2][2];
Matrix2x2() : a{{1, 0}, {0, 1}} {} Matrix2x2() : a{{1, 0}, {0, 1}} {}
Matrix2x2(T x, T y) : a{{0, x}, {x, y}} {} Matrix2x2(T x, T y) : a{{0, x}, {x, y}} {}
#if !__PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN #if !_PSTL_ICL_19_VC14_VC141_TEST_SCAN_RELEASE_BROKEN
Matrix2x2(const Matrix2x2& m) : a{{m.a[0][0], m.a[0][1]}, {m.a[1][0], m.a[1][1]}} {} Matrix2x2(const Matrix2x2& m) : a{{m.a[0][0], m.a[0][1]}, {m.a[1][0], m.a[1][1]}} {}
Matrix2x2& Matrix2x2&
operator=(const Matrix2x2& m) operator=(const Matrix2x2& m)
...@@ -607,13 +606,6 @@ multiply_matrix(const Matrix2x2<T>& left, const Matrix2x2<T>& right) ...@@ -607,13 +606,6 @@ multiply_matrix(const Matrix2x2<T>& left, const Matrix2x2<T>& right)
return result; return result;
} }
// Check that Intel(R) Threading Building Blocks header files are not used when parallel policies are off
#if !__PSTL_USE_PAR_POLICIES
#if defined(TBB_INTERFACE_VERSION)
#error The parallel backend is used while it should not (__PSTL_USE_PAR_POLICIES==0)
#endif
#endif
//============================================================================ //============================================================================
// Adapters for creating different types of iterators. // Adapters for creating different types of iterators.
// //
...@@ -659,7 +651,7 @@ struct ReverseAdapter ...@@ -659,7 +651,7 @@ struct ReverseAdapter
iterator_type iterator_type
operator()(Iterator it) operator()(Iterator it)
{ {
#if __PSTL_CPP14_MAKE_REVERSE_ITERATOR_PRESENT #if _PSTL_CPP14_MAKE_REVERSE_ITERATOR_PRESENT
return std::make_reverse_iterator(it); return std::make_reverse_iterator(it);
#else #else
return iterator_type(it); return iterator_type(it);
...@@ -1052,10 +1044,8 @@ invoke_on_all_policies(Op op, T&&... rest) ...@@ -1052,10 +1044,8 @@ invoke_on_all_policies(Op op, T&&... rest)
// Try static execution policies // Try static execution policies
invoke_on_all_iterator_types()(seq, op, std::forward<T>(rest)...); invoke_on_all_iterator_types()(seq, op, std::forward<T>(rest)...);
invoke_on_all_iterator_types()(unseq, op, std::forward<T>(rest)...); invoke_on_all_iterator_types()(unseq, op, std::forward<T>(rest)...);
#if __PSTL_USE_PAR_POLICIES
invoke_on_all_iterator_types()(par, op, std::forward<T>(rest)...); invoke_on_all_iterator_types()(par, op, std::forward<T>(rest)...);
invoke_on_all_iterator_types()(par_unseq, op, std::forward<T>(rest)...); invoke_on_all_iterator_types()(par_unseq, op, std::forward<T>(rest)...);
#endif
} }
template <typename F> template <typename F>
...@@ -1201,7 +1191,7 @@ transform_reduce_serial(InputIterator first, InputIterator last, T init, BinaryO ...@@ -1201,7 +1191,7 @@ transform_reduce_serial(InputIterator first, InputIterator last, T init, BinaryO
static const char* static const char*
done() done()
{ {
#if __PSTL_TEST_SUCCESSFUL_KEYWORD #if _PSTL_TEST_SUCCESSFUL_KEYWORD
return "done"; return "done";
#else #else
return "passed"; return "passed";
...@@ -1238,7 +1228,7 @@ template <typename Policy, typename F> ...@@ -1238,7 +1228,7 @@ template <typename Policy, typename F>
static void static void
invoke_if(Policy&& p, F f) invoke_if(Policy&& p, F f)
{ {
#if __PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || __PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN #if _PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || _PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN
__pstl::__internal::invoke_if_not(__pstl::__internal::allow_unsequenced<Policy>(), f); __pstl::__internal::invoke_if_not(__pstl::__internal::allow_unsequenced<Policy>(), f);
#else #else
f(); f();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment