operator=(const __buffer&) = delete;
public:
+ _LIBCPP_HIDE_FROM_ABI
__buffer(std::size_t __n) : __allocator_(), __ptr_(__allocator_.allocate(__n)), __buf_size_(__n) {}
- operator bool() const { return __ptr_ != nullptr; }
- _Tp*
+ _LIBCPP_HIDE_FROM_ABI operator bool() const { return __ptr_ != nullptr; }
+ _LIBCPP_HIDE_FROM_ABI _Tp*
get() const
{
return __ptr_;
}
- ~__buffer() { __allocator_.deallocate(__ptr_, __buf_size_); }
+ _LIBCPP_HIDE_FROM_ABI ~__buffer() { __allocator_.deallocate(__ptr_, __buf_size_); }
};
-inline void
+_LIBCPP_HIDE_FROM_ABI inline void
__cancel_execution()
{
}
template <class _ExecutionPolicy, class _Index, class _Fp>
-void
+_LIBCPP_HIDE_FROM_ABI void
__parallel_for(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _Index __first, _Index __last, _Fp __f)
{
__f(__first, __last);
}
template <class _ExecutionPolicy, class _Value, class _Index, typename _RealBody, typename _Reduction>
-_Value
+_LIBCPP_HIDE_FROM_ABI _Value
__parallel_reduce(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _Index __first, _Index __last,
const _Value& __identity, const _RealBody& __real_body, const _Reduction&)
{
}
template <class _ExecutionPolicy, class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce>
-_Tp
+_LIBCPP_HIDE_FROM_ABI _Tp
__parallel_transform_reduce(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _Index __first, _Index __last,
_UnaryOp, _Tp __init, _BinaryOp, _Reduce __reduce)
{
}
template <class _ExecutionPolicy, typename _Index, typename _Tp, typename _Rp, typename _Cp, typename _Sp, typename _Ap>
-void
+_LIBCPP_HIDE_FROM_ABI void
__parallel_strict_scan(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _Index __n, _Tp __initial,
_Rp __reduce, _Cp __combine, _Sp __scan, _Ap __apex)
{
}
template <class _ExecutionPolicy, class _Index, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduce, class _Scan>
-_Tp
+_LIBCPP_HIDE_FROM_ABI _Tp
__parallel_transform_scan(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _Index __n, _UnaryOp,
_Tp __init, _BinaryOp, _Reduce, _Scan __scan)
{
}
template <class _ExecutionPolicy, typename _RandomAccessIterator, typename _Compare, typename _LeafSort>
-void
+_LIBCPP_HIDE_FROM_ABI void
__parallel_stable_sort(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp, _LeafSort __leaf_sort, std::size_t = 0)
{
template <class _ExecutionPolicy, typename _RandomAccessIterator1, typename _RandomAccessIterator2,
typename _RandomAccessIterator3, typename _Compare, typename _LeafMerge>
-void
+_LIBCPP_HIDE_FROM_ABI void
__parallel_merge(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _RandomAccessIterator1 __first1,
_RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2,
_RandomAccessIterator3 __outit, _Compare __comp, _LeafMerge __leaf_merge)
}
template <class _ExecutionPolicy, typename _F1, typename _F2>
-void
+_LIBCPP_HIDE_FROM_ABI void
__parallel_invoke(__pstl::__internal::__serial_backend_tag, _ExecutionPolicy&&, _F1&& __f1, _F2&& __f2)
{
std::forward<_F1>(__f1)();
const std::size_t __lane_size = 64;
template <class _Iterator, class _DifferenceType, class _Function>
-_Iterator
+_LIBCPP_HIDE_FROM_ABI _Iterator
__simd_walk_1(_Iterator __first, _DifferenceType __n, _Function __f) noexcept
{
_PSTL_PRAGMA_SIMD
}
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function>
-_Iterator2
+_LIBCPP_HIDE_FROM_ABI _Iterator2
__simd_walk_2(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept
{
_PSTL_PRAGMA_SIMD
}
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function>
-_Iterator3
+_LIBCPP_HIDE_FROM_ABI _Iterator3
__simd_walk_3(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3,
_Function __f) noexcept
{
// TODO: check whether __simd_first() can be used here
template <class _Index, class _DifferenceType, class _Pred>
-bool
+_LIBCPP_HIDE_FROM_ABI bool
__simd_or(_Index __first, _DifferenceType __n, _Pred __pred) noexcept
{
#if defined(_PSTL_EARLYEXIT_PRESENT)
}
template <class _Index, class _DifferenceType, class _Compare>
-_Index
+_LIBCPP_HIDE_FROM_ABI _Index
__simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp) noexcept
{
#if defined(_PSTL_EARLYEXIT_PRESENT)
}
template <class _Index1, class _DifferenceType, class _Index2, class _Pred>
-std::pair<_Index1, _Index2>
+_LIBCPP_HIDE_FROM_ABI std::pair<_Index1, _Index2>
__simd_first(_Index1 __first1, _DifferenceType __n, _Index2 __first2, _Pred __pred) noexcept
{
#if defined(_PSTL_EARLYEXIT_PRESENT)
}
template <class _Index, class _DifferenceType, class _Pred>
-_DifferenceType
+_LIBCPP_HIDE_FROM_ABI _DifferenceType
__simd_count(_Index __index, _DifferenceType __n, _Pred __pred) noexcept
{
_DifferenceType __count = 0;
}
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _BinaryPredicate>
-_OutputIterator
+_LIBCPP_HIDE_FROM_ABI _OutputIterator
__simd_unique_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator __result,
_BinaryPredicate __pred) noexcept
{
}
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _Assigner>
-_OutputIterator
+_LIBCPP_HIDE_FROM_ABI _OutputIterator
__simd_assign(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _Assigner __assigner) noexcept
{
_PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
}
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _UnaryPredicate>
-_OutputIterator
+_LIBCPP_HIDE_FROM_ABI _OutputIterator
__simd_copy_if(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _UnaryPredicate __pred) noexcept
{
_DifferenceType __cnt = 0;
}
template <class _InputIterator, class _DifferenceType, class _BinaryPredicate>
-_DifferenceType
+_LIBCPP_HIDE_FROM_ABI _DifferenceType
__simd_calc_mask_2(_InputIterator __first, _DifferenceType __n, bool* __mask, _BinaryPredicate __pred) noexcept
{
_DifferenceType __count = 0;
}
template <class _InputIterator, class _DifferenceType, class _UnaryPredicate>
-_DifferenceType
+_LIBCPP_HIDE_FROM_ABI _DifferenceType
__simd_calc_mask_1(_InputIterator __first, _DifferenceType __n, bool* __mask, _UnaryPredicate __pred) noexcept
{
_DifferenceType __count = 0;
}
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _Assigner>
-void
+_LIBCPP_HIDE_FROM_ABI void
__simd_copy_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, bool* __mask,
_Assigner __assigner) noexcept
{
}
template <class _InputIterator, class _DifferenceType, class _OutputIterator1, class _OutputIterator2>
-void
+_LIBCPP_HIDE_FROM_ABI void
__simd_partition_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
_OutputIterator2 __out_false, bool* __mask) noexcept
{
}
template <class _Index, class _DifferenceType, class _Tp>
-_Index
+_LIBCPP_HIDE_FROM_ABI _Index
__simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept
{
_PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
}
template <class _Index, class _DifferenceType, class _Generator>
-_Index
+_LIBCPP_HIDE_FROM_ABI _Index
__simd_generate_n(_Index __first, _DifferenceType __size, _Generator __g) noexcept
{
_PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
}
template <class _Index, class _BinaryPredicate>
-_Index
+_LIBCPP_HIDE_FROM_ABI _Index
__simd_adjacent_find(_Index __first, _Index __last, _BinaryPredicate __pred, bool __or_semantic) noexcept
{
if (__last - __first < 2)
std::is_same<_BinaryOperation, std::plus<_Tp>>::value>;
template <typename _DifferenceType, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
-typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
+_LIBCPP_HIDE_FROM_ABI typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
__simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept
{
_PSTL_PRAGMA_SIMD_REDUCTION(+ : __init)
}
template <typename _Size, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
-typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
+_LIBCPP_HIDE_FROM_ABI typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
__simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept
{
const _Size __block_size = __lane_size / sizeof(_Tp);
// Exclusive scan for "+" and arithmetic types
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
+_LIBCPP_HIDE_FROM_ABI
typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
_BinaryOperation, /*Inclusive*/ std::false_type)
_Tp __value;
_BinaryOp* __bin_op; // Here is a pointer to function because of default ctor
- _Combiner() : __value{}, __bin_op(nullptr) {}
+ _LIBCPP_HIDE_FROM_ABI _Combiner() : __value{}, __bin_op(nullptr) {}
+ _LIBCPP_HIDE_FROM_ABI
_Combiner(const _Tp& value, const _BinaryOp* bin_op) : __value(value), __bin_op(const_cast<_BinaryOp*>(bin_op)) {}
- _Combiner(const _Combiner& __obj) : __value{}, __bin_op(__obj.__bin_op) {}
+ _LIBCPP_HIDE_FROM_ABI _Combiner(const _Combiner& __obj) : __value{}, __bin_op(__obj.__bin_op) {}
- void
+ _LIBCPP_HIDE_FROM_ABI void
operator()(const _Combiner& __obj)
{
__value = (*__bin_op)(__value, __obj.__value);
// Exclusive scan for other binary operations and types
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
+_LIBCPP_HIDE_FROM_ABI
typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
_BinaryOperation __binary_op, /*Inclusive*/ std::false_type)
// Inclusive scan for "+" and arithmetic types
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
+_LIBCPP_HIDE_FROM_ABI
typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
_BinaryOperation, /*Inclusive*/ std::true_type)
// Inclusive scan for other binary operations and types
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
+_LIBCPP_HIDE_FROM_ABI
typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
_BinaryOperation __binary_op, std::true_type)
// [restriction] - std::iterator_traits<_ForwardIterator>::value_type should be DefaultConstructible.
// complexity [violation] - We will have at most (__n-1 + number_of_lanes) comparisons instead of at most __n-1.
template <typename _ForwardIterator, typename _Size, typename _Compare>
-_ForwardIterator
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
__simd_min_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
{
if (__n == 0)
_Size __min_ind;
_Compare* __min_comp;
- _ComplexType() : __min_val{}, __min_ind{}, __min_comp(nullptr) {}
- _ComplexType(const _ValueType& val, const _Compare* comp)
+ _LIBCPP_HIDE_FROM_ABI _ComplexType() : __min_val{}, __min_ind{}, __min_comp(nullptr) {}
+ _LIBCPP_HIDE_FROM_ABI _ComplexType(const _ValueType& val, const _Compare* comp)
: __min_val(val), __min_ind(0), __min_comp(const_cast<_Compare*>(comp))
{
}
- _ComplexType(const _ComplexType& __obj)
+ _LIBCPP_HIDE_FROM_ABI _ComplexType(const _ComplexType& __obj)
: __min_val(__obj.__min_val), __min_ind(__obj.__min_ind), __min_comp(__obj.__min_comp)
{
}
_PSTL_PRAGMA_DECLARE_SIMD
- void
+ _LIBCPP_HIDE_FROM_ABI void
operator()(const _ComplexType& __obj)
{
if (!(*__min_comp)(__min_val, __obj.__min_val) &&
// [restriction] - std::iterator_traits<_ForwardIterator>::value_type should be DefaultConstructible.
// complexity [violation] - We will have at most (2*(__n-1) + 4*number_of_lanes) comparisons instead of at most [1.5*(__n-1)].
template <typename _ForwardIterator, typename _Size, typename _Compare>
-std::pair<_ForwardIterator, _ForwardIterator>
+_LIBCPP_HIDE_FROM_ABI std::pair<_ForwardIterator, _ForwardIterator>
__simd_minmax_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
{
if (__n == 0)
_Size __max_ind;
_Compare* __minmax_comp;
- _ComplexType() : __min_val{}, __max_val{}, __min_ind{}, __max_ind{}, __minmax_comp(nullptr) {}
- _ComplexType(const _ValueType& min_val, const _ValueType& max_val, const _Compare* comp)
+ _LIBCPP_HIDE_FROM_ABI _ComplexType() : __min_val{}, __max_val{}, __min_ind{}, __max_ind{}, __minmax_comp(nullptr) {}
+ _LIBCPP_HIDE_FROM_ABI _ComplexType(const _ValueType& min_val, const _ValueType& max_val, const _Compare* comp)
: __min_val(min_val), __max_val(max_val), __min_ind(0), __max_ind(0),
__minmax_comp(const_cast<_Compare*>(comp))
{
}
- _ComplexType(const _ComplexType& __obj)
+ _LIBCPP_HIDE_FROM_ABI _ComplexType(const _ComplexType& __obj)
: __min_val(__obj.__min_val), __max_val(__obj.__max_val), __min_ind(__obj.__min_ind),
__max_ind(__obj.__max_ind), __minmax_comp(__obj.__minmax_comp)
{
}
- void
+ _LIBCPP_HIDE_FROM_ABI void
operator()(const _ComplexType& __obj)
{
// min
template <class _InputIterator, class _DifferenceType, class _OutputIterator1, class _OutputIterator2,
class _UnaryPredicate>
-std::pair<_OutputIterator1, _OutputIterator2>
+_LIBCPP_HIDE_FROM_ABI std::pair<_OutputIterator1, _OutputIterator2>
__simd_partition_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
_OutputIterator2 __out_false, _UnaryPredicate __pred) noexcept
{
}
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator1
__simd_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last, _BinaryPredicate __pred) noexcept
{
}
template <class _RandomAccessIterator, class _DifferenceType, class _UnaryPredicate>
-_RandomAccessIterator
+_LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
__simd_remove_if(_RandomAccessIterator __first, _DifferenceType __n, _UnaryPredicate __pred) noexcept
{
// find first element we need to remove
namespace __internal {
template <typename _Fp>
-auto __except_handler(_Fp __f) -> decltype(__f()) {
+_LIBCPP_HIDE_FROM_ABI auto __except_handler(_Fp __f) -> decltype(__f()) {
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <typename _Fp>
-void __invoke_if(std::true_type, _Fp __f) {
+_LIBCPP_HIDE_FROM_ABI void __invoke_if(std::true_type, _Fp __f) {
__f();
}
template <typename _Fp>
-void __invoke_if(std::false_type, _Fp) {}
+_LIBCPP_HIDE_FROM_ABI void __invoke_if(std::false_type, _Fp) {}
template <typename _Fp>
-void __invoke_if_not(std::false_type, _Fp __f) {
+_LIBCPP_HIDE_FROM_ABI void __invoke_if_not(std::false_type, _Fp __f) {
__f();
}
template <typename _Fp>
-void __invoke_if_not(std::true_type, _Fp) {}
+_LIBCPP_HIDE_FROM_ABI void __invoke_if_not(std::true_type, _Fp) {}
template <typename _F1, typename _F2>
-auto __invoke_if_else(std::true_type, _F1 __f1, _F2) -> decltype(__f1()) {
+_LIBCPP_HIDE_FROM_ABI auto __invoke_if_else(std::true_type, _F1 __f1, _F2) -> decltype(__f1()) {
return __f1();
}
template <typename _F1, typename _F2>
-auto __invoke_if_else(std::false_type, _F1, _F2 __f2) -> decltype(__f2()) {
+_LIBCPP_HIDE_FROM_ABI auto __invoke_if_else(std::false_type, _F1, _F2 __f2) -> decltype(__f2()) {
return __f2();
}
//! Unary operator that returns reference to its argument.
struct __no_op {
template <typename _Tp>
- _Tp&& operator()(_Tp&& __a) const {
+ _LIBCPP_HIDE_FROM_ABI _Tp&& operator()(_Tp&& __a) const {
return std::forward<_Tp>(__a);
}
};
_Pred _M_pred;
public:
- explicit __reorder_pred(_Pred __pred) : _M_pred(__pred) {}
+ _LIBCPP_HIDE_FROM_ABI explicit __reorder_pred(_Pred __pred) : _M_pred(__pred) {}
template <typename _FTp, typename _STp>
- bool operator()(_FTp&& __a, _STp&& __b) {
+ _LIBCPP_HIDE_FROM_ABI bool operator()(_FTp&& __a, _STp&& __b) {
return _M_pred(std::forward<_STp>(__b), std::forward<_FTp>(__a));
}
};
_Predicate _M_pred;
public:
- __equal_value_by_pred(const _Tp& __value, _Predicate __pred) : _M_value(__value), _M_pred(__pred) {}
+ _LIBCPP_HIDE_FROM_ABI __equal_value_by_pred(const _Tp& __value, _Predicate __pred)
+ : _M_value(__value), _M_pred(__pred) {}
template <typename _Arg>
- bool operator()(_Arg&& __arg) {
+ _LIBCPP_HIDE_FROM_ABI bool operator()(_Arg&& __arg) {
return _M_pred(std::forward<_Arg>(__arg), _M_value);
}
};
const _Tp& _M_value;
public:
- explicit __equal_value(const _Tp& __value) : _M_value(__value) {}
+ _LIBCPP_HIDE_FROM_ABI explicit __equal_value(const _Tp& __value) : _M_value(__value) {}
template <typename _Arg>
- bool operator()(_Arg&& __arg) const {
+ _LIBCPP_HIDE_FROM_ABI bool operator()(_Arg&& __arg) const {
return std::forward<_Arg>(__arg) == _M_value;
}
};
const _Tp& _M_value;
public:
- explicit __not_equal_value(const _Tp& __value) : _M_value(__value) {}
+ _LIBCPP_HIDE_FROM_ABI explicit __not_equal_value(const _Tp& __value) : _M_value(__value) {}
template <typename _Arg>
- bool operator()(_Arg&& __arg) const {
+ _LIBCPP_HIDE_FROM_ABI bool operator()(_Arg&& __arg) const {
return !(std::forward<_Arg>(__arg) == _M_value);
}
};
template <typename _ForwardIterator, typename _Compare>
-_ForwardIterator __cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare __comp) {
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator
+__cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare __comp) {
if (__a < __b) { // we should return closer iterator
return __comp(*__b, *__a) ? __b : __a;
} else {