32#ifndef _GLIBCXX_PARALLEL_BASE_H
33#define _GLIBCXX_PARALLEL_BASE_H 1
48namespace std _GLIBCXX_VISIBILITY(default)
50 namespace __parallel { }
70#ifdef _GLIBCXX_PARALLEL
71 using namespace std::_GLIBCXX_STD_A;
88 return __i > 1 ? __i : 1;
100 template<
typename _Size>
105 for (
__k = 0; __n > 1; __n >>= 1)
142 template<
typename _Tp>
144 min(
const _Tp& __a,
const _Tp& __b)
145 {
return (__a < __b) ? __a : __b; }
148 template<
typename _Tp>
150 max(
const _Tp& __a,
const _Tp& __b)
151 {
return (__a > __b) ? __a : __b; }
153#pragma GCC diagnostic push
154#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
159 template<
typename _T1,
typename _T2,
typename _Compare>
168 bool operator()(
const _T1& __a,
const _T2& __b)
169 {
return !_M_comp(__a, __b) && !_M_comp(__b, __a); }
174 template<
typename _Predicate,
typename argument_type>
187 {
return !_M_pred(__x); }
192 template<
typename _Operation,
typename _FirstArgumentType,
193 typename _SecondArgumentType,
typename _ResultType>
199 _FirstArgumentType _M_value;
202 __binder1st(
const _Operation& __x,
const _FirstArgumentType& __y)
203 : _M_op(__x), _M_value(__y) { }
206 operator()(
const _SecondArgumentType& __x)
207 {
return _M_op(_M_value, __x); }
212 operator()(_SecondArgumentType& __x)
const
213 {
return _M_op(_M_value, __x); }
220 template<
typename _Operation,
typename _FirstArgumentType,
221 typename _SecondArgumentType,
typename _ResultType>
227 _SecondArgumentType _M_value;
230 __binder2nd(
const _Operation& __x,
const _SecondArgumentType& __y)
231 : _M_op(__x), _M_value(__y) { }
234 operator()(
const _FirstArgumentType& __x)
const
235 {
return _M_op(__x, _M_value); }
240 operator()(_FirstArgumentType& __x)
241 {
return _M_op(__x, _M_value); }
245 template<
typename _T1,
typename _T2>
248 bool operator()(
const _T1&
__t1,
const _T2&
__t2)
const
253 template<
typename _T1,
typename _T2>
257 operator()(
const _T1&
__t1,
const _T2&
__t2)
const
261 operator()(
const _T2&
__t2,
const _T1&
__t1)
const
266 template<
typename _Tp>
267 struct _Less<_Tp, _Tp>
271 template<
typename _Tp1,
typename _Tp2,
typename _Result
272 = __typeof__(*
static_cast<_Tp1*
>(0)
273 + *
static_cast<_Tp2*
>(0))>
277 operator()(
const _Tp1& __x,
const _Tp2& __y)
const
278 {
return __x + __y; }
282 template<
typename _Tp>
283 struct _Plus<_Tp, _Tp, _Tp>
287 template<
typename _Tp1,
typename _Tp2,
typename _Result
288 = __typeof__(*
static_cast<_Tp1*
>(0)
289 * *
static_cast<_Tp2*
>(0))>
293 operator()(
const _Tp1& __x,
const _Tp2& __y)
const
294 {
return __x * __y; }
298 template<
typename _Tp>
302#pragma GCC diagnostic pop
309 template<
typename _Tp,
typename _DifferenceTp>
313 typedef _DifferenceTp _DifferenceType;
316 : _M_val(__val), _M_pos(
__pos) { }
336 operator[](_DifferenceType)
const
341 {
return _M_pos ==
__i2._M_pos; }
345 {
return _M_pos !=
__i2._M_pos; }
349 {
return _M_pos -
__i2._M_pos; }
353 _DifferenceType _M_pos;
362 template<
typename _Tp,
typename _DifferenceTp>
366 typedef _DifferenceTp _DifferenceType;
376 : _M_val(__val), _M_count(__count) { }
386 {
return iterator(_M_val, _M_count); }
390 _DifferenceType _M_count;
400 template<
typename _RAIter,
typename _Compare>
403 _RAIter __c, _Compare __comp)
405 if (__comp(*__a, *__b))
406 if (__comp(*__b, *__c))
409 if (__comp(*__a, *__c))
416 if (__comp(*__a, *__c))
419 if (__comp(*__b, *__c))
426#if _GLIBCXX_PARALLEL_ASSERTIONS && defined(__glibcxx_assert_impl)
427# define _GLIBCXX_PARALLEL_ASSERT(_Condition) \
428 do { __glibcxx_assert_impl(_Condition); } while (false)
430# define _GLIBCXX_PARALLEL_ASSERT(_Condition) do { } while (false)
Includes the original header files concerned with iterators except for stream iterators....
End-user include file. Provides advanced settings and tuning options. This file is a GNU parallel ext...
Defines on whether to include algorithm variants.
ISO C++ entities toplevel namespace is std.
GNU parallel code, replaces standard behavior with parallel behavior.
GNU parallel code for public use.
uint16_t _ThreadIndex
Unsigned integer to index a thread number. The maximum thread number (for each processor) must fit in...
const _Tp & max(const _Tp &__a, const _Tp &__b)
Equivalent to std::max.
const _Tp & min(const _Tp &__a, const _Tp &__b)
Equivalent to std::min.
_RAIter __median_of_three_iterators(_RAIter __a, _RAIter __b, _RAIter __c, _Compare __comp)
Compute the median of three referenced elements, according to __comp.
_Parallelism
Run-time equivalents for the compile-time tags.
@ sequential
Not parallel.
_CASable __encode2(int __a, int __b)
Encode two integers into one gnu_parallel::_CASable.
int64_t _CASable
Longest compare-and-swappable integer type on this platform.
static const _CASable _CASable_mask
_CASable with the right half of bits set to 1.
static const int _CASable_bits
Number of bits of _CASable.
_Size __rd_log2(_Size __n)
Calculates the rounded-down logarithm of __n for base 2.
void __decode2(_CASable __x, int &__a, int &__b)
Decode two integers from one gnu_parallel::_CASable.
GNU sequential classes for public use.
argument_type argument_type
argument_type is the type of the argument
One of the math functors.
One of the math functors.
One of the comparison functors.
Constructs predicate for equality from strict weak ordering predicate.
Similar to std::unary_negate, but giving the argument types explicitly.
Similar to std::binder1st, but giving the argument types explicitly.
Similar to std::binder2nd, but giving the argument types explicitly.
Similar to std::equal_to, but allows two different types.
Similar to std::less, but allows two different types.
Similar to std::plus, but allows two different types.
Similar to std::multiplies, but allows two different types.
_Iterator associated with __gnu_parallel::_PseudoSequence. If features the usual random-access iterat...
Sequence that conceptually consists of multiple copies of the same element. The copies are not stored...
iterator begin() const
Begin iterator.
iterator end() const
End iterator.
_PseudoSequence(const _Tp &__val, _DifferenceType __count)
Constructor.