@@ -410,8 +410,8 @@ __simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _Un
410
410
const _Size __block_size = __lane_size / sizeof (_Tp);
411
411
if (__n > 2 * __block_size && __block_size > 1 )
412
412
{
413
- alignas (__lane_size) char __lane_ [__lane_size];
414
- _Tp* __lane = reinterpret_cast <_Tp*>(__lane_ );
413
+ alignas (__lane_size) char __lane_buffer [__lane_size];
414
+ _Tp* __lane = reinterpret_cast <_Tp*>(__lane_buffer );
415
415
416
416
// initializer
417
417
_PSTL_PRAGMA_SIMD
@@ -421,8 +421,8 @@ __simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _Un
421
421
}
422
422
// main loop
423
423
_Size __i = 2 * __block_size;
424
- const _Size last_iteration = __block_size * (__n / __block_size);
425
- for (; __i < last_iteration ; __i += __block_size)
424
+ const _Size __last_iteration = __block_size * (__n / __block_size);
425
+ for (; __i < __last_iteration ; __i += __block_size)
426
426
{
427
427
_PSTL_PRAGMA_SIMD
428
428
for (_Size __j = 0 ; __j < __block_size; ++__j)
@@ -432,9 +432,9 @@ __simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _Un
432
432
}
433
433
// remainder
434
434
_PSTL_PRAGMA_SIMD
435
- for (_Size __j = 0 ; __j < __n - last_iteration ; ++__j)
435
+ for (_Size __j = 0 ; __j < __n - __last_iteration ; ++__j)
436
436
{
437
- __lane[__j] = __binary_op (__lane[__j], __f (last_iteration + __j));
437
+ __lane[__j] = __binary_op (__lane[__j], __f (__last_iteration + __j));
438
438
}
439
439
// combiner
440
440
for (_Size __j = 0 ; __j < __block_size; ++__j)
@@ -480,18 +480,19 @@ __simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryO
480
480
template <typename _Tp, typename _BinaryOp>
481
481
struct _Combiner
482
482
{
483
- _Tp __value ;
484
- _BinaryOp* __bin_op ; // Here is a pointer to function because of default ctor
483
+ _Tp __value_ ;
484
+ _BinaryOp* __bin_op_ ; // Here is a pointer to function because of default ctor
485
485
486
- _LIBCPP_HIDE_FROM_ABI _Combiner () : __value {}, __bin_op (nullptr ) {}
486
+ _LIBCPP_HIDE_FROM_ABI _Combiner () : __value_ {}, __bin_op_ (nullptr ) {}
487
487
_LIBCPP_HIDE_FROM_ABI
488
- _Combiner (const _Tp& value, const _BinaryOp* bin_op) : __value(value), __bin_op(const_cast <_BinaryOp*>(bin_op)) {}
489
- _LIBCPP_HIDE_FROM_ABI _Combiner (const _Combiner& __obj) : __value{}, __bin_op(__obj.__bin_op) {}
488
+ _Combiner (const _Tp& __value, const _BinaryOp* __bin_op)
489
+ : __value_(__value), __bin_op_(const_cast <_BinaryOp*>(__bin_op)) {}
490
+ _LIBCPP_HIDE_FROM_ABI _Combiner (const _Combiner& __obj) : __value_{}, __bin_op_(__obj.__bin_op) {}
490
491
491
492
_LIBCPP_HIDE_FROM_ABI void
492
493
operator ()(const _Combiner& __obj)
493
494
{
494
- __value = (*__bin_op)(__value , __obj.__value );
495
+ __value_ = (*__bin_op_)(__value_ , __obj.__value_ );
495
496
}
496
497
};
497
498
@@ -504,17 +505,17 @@ __simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryO
504
505
_BinaryOperation __binary_op, /* Inclusive*/ std::false_type)
505
506
{
506
507
typedef _Combiner<_Tp, _BinaryOperation> _CombinerType;
507
- _CombinerType __init_ {__init, &__binary_op};
508
+ _CombinerType __combined_init {__init, &__binary_op};
508
509
509
510
_PSTL_PRAGMA_DECLARE_REDUCTION (__bin_op, _CombinerType)
510
511
_PSTL_PRAGMA_SIMD_SCAN (__bin_op : __init_)
511
512
for (_Size __i = 0 ; __i < __n; ++__i)
512
513
{
513
- __result[__i] = __init_. __value ;
514
+ __result[__i] = __combined_init. __value_ ;
514
515
_PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN (__init_)
515
- __init_. __value = __binary_op (__init_. __value , __unary_op (__first[__i]));
516
+ __combined_init. __value_ = __binary_op (__combined_init. __value_ , __unary_op (__first[__i]));
516
517
}
517
- return std::make_pair (__result + __n, __init_. __value );
518
+ return std::make_pair (__result + __n, __combined_init. __value_ );
518
519
}
519
520
520
521
// Inclusive scan for "+" and arithmetic types
@@ -544,17 +545,17 @@ __simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryO
544
545
_BinaryOperation __binary_op, std::true_type)
545
546
{
546
547
typedef _Combiner<_Tp, _BinaryOperation> _CombinerType;
547
- _CombinerType __init_ {__init, &__binary_op};
548
+ _CombinerType __combined_init {__init, &__binary_op};
548
549
549
550
_PSTL_PRAGMA_DECLARE_REDUCTION (__bin_op, _CombinerType)
550
551
_PSTL_PRAGMA_SIMD_SCAN (__bin_op : __init_)
551
552
for (_Size __i = 0 ; __i < __n; ++__i)
552
553
{
553
- __init_. __value = __binary_op (__init_. __value , __unary_op (__first[__i]));
554
+ __combined_init. __value_ = __binary_op (__combined_init. __value_ , __unary_op (__first[__i]));
554
555
_PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN (__init_)
555
- __result[__i] = __init_. __value ;
556
+ __result[__i] = __combined_init. __value_ ;
556
557
}
557
- return std::make_pair (__result + __n, __init_. __value );
558
+ return std::make_pair (__result + __n, __combined_init. __value_ );
558
559
}
559
560
560
561
// [restriction] - std::iterator_traits<_ForwardIterator>::value_type should be DefaultConstructible.
@@ -571,29 +572,29 @@ __simd_min_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcep
571
572
typedef typename std::iterator_traits<_ForwardIterator>::value_type _ValueType;
572
573
struct _ComplexType
573
574
{
574
- _ValueType __min_val ;
575
- _Size __min_ind ;
576
- _Compare* __min_comp ;
575
+ _ValueType __min_val_ ;
576
+ _Size __min_ind_ ;
577
+ _Compare* __min_comp_ ;
577
578
578
- _LIBCPP_HIDE_FROM_ABI _ComplexType () : __min_val {}, __min_ind {}, __min_comp (nullptr ) {}
579
- _LIBCPP_HIDE_FROM_ABI _ComplexType (const _ValueType& val , const _Compare* comp )
580
- : __min_val(val ), __min_ind (0 ), __min_comp (const_cast <_Compare*>(comp ))
579
+ _LIBCPP_HIDE_FROM_ABI _ComplexType () : __min_val_ {}, __min_ind_ {}, __min_comp_ (nullptr ) {}
580
+ _LIBCPP_HIDE_FROM_ABI _ComplexType (const _ValueType& __val , const _Compare* __comp )
581
+ : __min_val_(__val ), __min_ind_ (0 ), __min_comp_ (const_cast <_Compare*>(__comp ))
581
582
{
582
583
}
583
584
_LIBCPP_HIDE_FROM_ABI _ComplexType (const _ComplexType& __obj)
584
- : __min_val (__obj.__min_val ), __min_ind (__obj.__min_ind ), __min_comp (__obj.__min_comp )
585
+ : __min_val_ (__obj.__min_val_ ), __min_ind_ (__obj.__min_ind_ ), __min_comp_ (__obj.__min_comp_ )
585
586
{
586
587
}
587
588
588
589
_PSTL_PRAGMA_DECLARE_SIMD
589
590
_LIBCPP_HIDE_FROM_ABI void
590
591
operator ()(const _ComplexType& __obj)
591
592
{
592
- if (!(*__min_comp)(__min_val , __obj.__min_val ) &&
593
- ((*__min_comp )(__obj.__min_val , __min_val ) || __obj.__min_ind - __min_ind < 0 ))
593
+ if (!(*__min_comp_)(__min_val_ , __obj.__min_val_ ) &&
594
+ ((*__min_comp_ )(__obj.__min_val_ , __min_val_ ) || __obj.__min_ind_ - __min_ind_ < 0 ))
594
595
{
595
- __min_val = __obj.__min_val ;
596
- __min_ind = __obj.__min_ind ;
596
+ __min_val_ = __obj.__min_val_ ;
597
+ __min_ind_ = __obj.__min_ind_ ;
597
598
}
598
599
}
599
600
};
@@ -605,15 +606,15 @@ __simd_min_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcep
605
606
_PSTL_PRAGMA_SIMD_REDUCTION (__min_func : __init)
606
607
for (_Size __i = 1 ; __i < __n; ++__i)
607
608
{
608
- const _ValueType __min_val = __init.__min_val ;
609
+ const _ValueType __min_val = __init.__min_val_ ;
609
610
const _ValueType __current = __first[__i];
610
611
if (__comp (__current, __min_val))
611
612
{
612
- __init.__min_val = __current;
613
- __init.__min_ind = __i;
613
+ __init.__min_val_ = __current;
614
+ __init.__min_ind_ = __i;
614
615
}
615
616
}
616
- return __first + __init.__min_ind ;
617
+ return __first + __init.__min_ind_ ;
617
618
}
618
619
619
620
// [restriction] - std::iterator_traits<_ForwardIterator>::value_type should be DefaultConstructible.
@@ -630,49 +631,51 @@ __simd_minmax_element(_ForwardIterator __first, _Size __n, _Compare __comp) noex
630
631
631
632
struct _ComplexType
632
633
{
633
- _ValueType __min_val ;
634
- _ValueType __max_val ;
635
- _Size __min_ind ;
636
- _Size __max_ind ;
634
+ _ValueType __min_val_ ;
635
+ _ValueType __max_val_ ;
636
+ _Size __min_ind_ ;
637
+ _Size __max_ind_ ;
637
638
_Compare* __minmax_comp;
638
639
639
- _LIBCPP_HIDE_FROM_ABI _ComplexType () : __min_val{}, __max_val{}, __min_ind{}, __max_ind{}, __minmax_comp(nullptr ) {}
640
- _LIBCPP_HIDE_FROM_ABI _ComplexType (const _ValueType& min_val, const _ValueType& max_val, const _Compare* comp)
641
- : __min_val(min_val), __max_val(max_val), __min_ind(0 ), __max_ind(0 ),
642
- __minmax_comp(const_cast <_Compare*>(comp))
640
+ _LIBCPP_HIDE_FROM_ABI _ComplexType ()
641
+ : __min_val_{}, __max_val_{}, __min_ind_{}, __max_ind_{}, __minmax_comp(nullptr ) {}
642
+ _LIBCPP_HIDE_FROM_ABI _ComplexType (
643
+ const _ValueType& __min_val, const _ValueType& __max_val, const _Compare* __comp)
644
+ : __min_val_(__min_val), __max_val_(__max_val), __min_ind_(0 ), __max_ind_(0 ),
645
+ __minmax_comp(const_cast <_Compare*>(__comp))
643
646
{
644
647
}
645
648
_LIBCPP_HIDE_FROM_ABI _ComplexType (const _ComplexType& __obj)
646
- : __min_val (__obj.__min_val ), __max_val (__obj.__max_val ), __min_ind (__obj.__min_ind ),
647
- __max_ind (__obj.__max_ind ), __minmax_comp(__obj.__minmax_comp)
649
+ : __min_val_ (__obj.__min_val_ ), __max_val_ (__obj.__max_val_ ), __min_ind_ (__obj.__min_ind_ ),
650
+ __max_ind_ (__obj.__max_ind_ ), __minmax_comp(__obj.__minmax_comp)
648
651
{
649
652
}
650
653
651
654
_LIBCPP_HIDE_FROM_ABI void
652
655
operator ()(const _ComplexType& __obj)
653
656
{
654
657
// min
655
- if ((*__minmax_comp)(__obj.__min_val , __min_val ))
658
+ if ((*__minmax_comp)(__obj.__min_val_ , __min_val_ ))
656
659
{
657
- __min_val = __obj.__min_val ;
658
- __min_ind = __obj.__min_ind ;
660
+ __min_val_ = __obj.__min_val_ ;
661
+ __min_ind_ = __obj.__min_ind_ ;
659
662
}
660
- else if (!(*__minmax_comp)(__min_val , __obj.__min_val ))
663
+ else if (!(*__minmax_comp)(__min_val_ , __obj.__min_val_ ))
661
664
{
662
- __min_val = __obj.__min_val ;
663
- __min_ind = (__min_ind - __obj.__min_ind < 0 ) ? __min_ind : __obj.__min_ind ;
665
+ __min_val_ = __obj.__min_val_ ;
666
+ __min_ind_ = (__min_ind_ - __obj.__min_ind_ < 0 ) ? __min_ind_ : __obj.__min_ind_ ;
664
667
}
665
668
666
669
// max
667
- if ((*__minmax_comp)(__max_val , __obj.__max_val ))
670
+ if ((*__minmax_comp)(__max_val_ , __obj.__max_val_ ))
668
671
{
669
- __max_val = __obj.__max_val ;
670
- __max_ind = __obj.__max_ind ;
672
+ __max_val_ = __obj.__max_val_ ;
673
+ __max_ind_ = __obj.__max_ind_ ;
671
674
}
672
- else if (!(*__minmax_comp)(__obj.__max_val , __max_val ))
675
+ else if (!(*__minmax_comp)(__obj.__max_val_ , __max_val_ ))
673
676
{
674
- __max_val = __obj.__max_val ;
675
- __max_ind = (__max_ind - __obj.__max_ind < 0 ) ? __obj.__max_ind : __max_ind ;
677
+ __max_val_ = __obj.__max_val_ ;
678
+ __max_ind_ = (__max_ind_ - __obj.__max_ind_ < 0 ) ? __obj.__max_ind_ : __max_ind_ ;
676
679
}
677
680
}
678
681
};
@@ -684,21 +687,21 @@ __simd_minmax_element(_ForwardIterator __first, _Size __n, _Compare __comp) noex
684
687
_PSTL_PRAGMA_SIMD_REDUCTION (__min_func : __init)
685
688
for (_Size __i = 1 ; __i < __n; ++__i)
686
689
{
687
- auto __min_val = __init.__min_val ;
688
- auto __max_val = __init.__max_val ;
690
+ auto __min_val = __init.__min_val_ ;
691
+ auto __max_val = __init.__max_val_ ;
689
692
auto __current = __first + __i;
690
693
if (__comp (*__current, __min_val))
691
694
{
692
- __init.__min_val = *__current;
693
- __init.__min_ind = __i;
695
+ __init.__min_val_ = *__current;
696
+ __init.__min_ind_ = __i;
694
697
}
695
698
else if (!__comp (*__current, __max_val))
696
699
{
697
- __init.__max_val = *__current;
698
- __init.__max_ind = __i;
700
+ __init.__max_val_ = *__current;
701
+ __init.__max_ind_ = __i;
699
702
}
700
703
}
701
- return std::make_pair (__first + __init.__min_ind , __first + __init.__max_ind );
704
+ return std::make_pair (__first + __init.__min_ind_ , __first + __init.__max_ind_ );
702
705
}
703
706
704
707
template <class _InputIterator , class _DifferenceType , class _OutputIterator1 , class _OutputIterator2 ,
0 commit comments