Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-10 Thread Jonathan Wakely

On 09/04/19 14:48 -0700, Thomas Rodgers wrote:


Committed to trunk.


Thanks!

For the record, I approved the patch over IRC but I forgot to say so
on the list.




Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-09 Thread Thomas Rodgers


Committed to trunk.

Thomas Rodgers writes:

> This patch adds additional internal namespace qualifications to the pstl
> implementation.
>
> From 35dba02035ebb5fd44ac0f06e25a81dfef05898f Mon Sep 17 00:00:00 2001
> From: Thomas Rodgers 
> Date: Thu, 28 Mar 2019 17:23:49 -0700
> Subject: [PATCH] Add namespace qualification for pstl-internal symbols
>
> Prevent ADL related weirdness.
>
>   * include/pstl/algorithm_impl.h: Add namespace qualification.
>   * include/pstl/execution_defs.h: Add namespace qualification.
>   * include/pstl/execution_impl.h: Add namespace qualification.
>   * include/pstl/numeric_impl.h: Add namespace qualification.
>   * include/pstl/parallel_backend_tbb.h: Add namespace qualification.
>   * include/pstl/unseq_backend_simd.h: Add namespace qualification.
>   * include/pstl/parallel_backend_utils.h: Include .
> ---
>  libstdc++-v3/include/pstl/algorithm_impl.h| 427 +-
>  libstdc++-v3/include/pstl/execution_defs.h|  10 +-
>  libstdc++-v3/include/pstl/execution_impl.h|  22 +-
>  libstdc++-v3/include/pstl/numeric_impl.h  |  30 +-
>  .../include/pstl/parallel_backend_tbb.h   |  49 +-
>  .../include/pstl/parallel_backend_utils.h |   1 +
>  .../include/pstl/unseq_backend_simd.h |   8 +-
>  7 files changed, 275 insertions(+), 272 deletions(-)
>
> diff --git a/libstdc++-v3/include/pstl/algorithm_impl.h 
> b/libstdc++-v3/include/pstl/algorithm_impl.h
> index 9d8242873ab..e06bf60151e 100644
> --- a/libstdc++-v3/include/pstl/algorithm_impl.h
> +++ b/libstdc++-v3/include/pstl/algorithm_impl.h
> @@ -18,6 +18,7 @@
>  
>  #include "execution_impl.h"
>  #include "memory_impl.h"
> +#include "parallel_backend_utils.h"
>  #include "unseq_backend_simd.h"
>  
>  #if __PSTL_USE_PAR_POLICIES
> @@ -55,7 +56,7 @@ bool
>  __pattern_any_of(_ExecutionPolicy&&, _ForwardIterator __first, 
> _ForwardIterator __last, _Pred __pred,
>   _IsVector __is_vector, /*parallel=*/std::false_type) 
> noexcept
>  {
> -return __brick_any_of(__first, __last, __pred, __is_vector);
> +return __internal::__brick_any_of(__first, __last, __pred, __is_vector);
>  }
>  
>  #if __PSTL_USE_PAR_POLICIES
> @@ -64,10 +65,10 @@ bool
>  __pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, 
> _ForwardIterator __last, _Pred __pred,
>   _IsVector __is_vector, /*parallel=*/std::true_type)
>  {
> -return __except_handler([&]() {
> -return __parallel_or(std::forward<_ExecutionPolicy>(__exec), 
> __first, __last,
> +return __internal::__except_handler([&]() {
> +   return 
> __internal::__parallel_or(std::forward<_ExecutionPolicy>(__exec), __first, 
> __last,
>   [__pred, __is_vector](_ForwardIterator __i, 
> _ForwardIterator __j) {
> - return __brick_any_of(__i, __j, __pred, 
> __is_vector);
> + return __internal::__brick_any_of(__i, __j, 
> __pred, __is_vector);
>   });
>  });
>  }
> @@ -111,7 +112,7 @@ __pattern_walk1(_ExecutionPolicy&&, _ForwardIterator 
> __first, _ForwardIterator _
>  _IsVector __is_vector,
>  /*parallel=*/std::false_type) noexcept
>  {
> -__brick_walk1(__first, __last, __f, __is_vector);
> +__internal::__brick_walk1(__first, __last, __f, __is_vector);
>  }
>  
>  #if __PSTL_USE_PAR_POLICIES
> @@ -121,10 +122,10 @@ __pattern_walk1(_ExecutionPolicy&& __exec, 
> _ForwardIterator __first, _ForwardIte
>  _IsVector __is_vector,
>  /*parallel=*/std::true_type)
>  {
> -__except_handler([&]() {
> +__internal::__except_handler([&]() {
>  
> __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), 
> __first, __last,
>[__f, __is_vector](_ForwardIterator 
> __i, _ForwardIterator __j) {
> -  __brick_walk1(__i, __j, __f, 
> __is_vector);
> +  __internal::__brick_walk1(__i, 
> __j, __f, __is_vector);
>});
>  });
>  }
> @@ -144,7 +145,7 @@ void
>  __pattern_walk_brick(_ExecutionPolicy&& __exec, _ForwardIterator __first, 
> _ForwardIterator __last, _Brick __brick,
>   /*parallel=*/std::true_type)
>  {
> -__except_handler([&]() {
> +__internal::__except_handler([&]() {
>  
> __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), 
> __first, __last,
>[__brick](_ForwardIterator __i, 
> _ForwardIterator __j) { __brick(__i, __j); });
>  });
> @@ -158,7 +159,7 @@ template  _Function>
>  _ForwardIterator
>  __brick_walk1_n(_ForwardIterator __first, _Size __n, _Function __f, 
> /*_IsVectorTag=*/std::false_type)
>  {
> -return __for_each_n_it_serial(__first, __n,
> +return 

Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-05 Thread Thomas Rodgers
>From d95934a0f325e0934ada829378c3c0dfd6b3628c Mon Sep 17 00:00:00 2001
From: Thomas Rodgers 
Date: Fri, 5 Apr 2019 15:27:35 -0700
Subject: [PATCH] Replace direct PSTL uses of assert() with a macro

This also replaces calls to __TBB_ASSERT so that there are two macro
definitions provided by c++config -
	__PSTL_ASSERT(_Condition)
	__PSTL_ASSERT_MSG(_Condition, _Message)

	* include/bits/c++config:
	Add definition for __PSTL_ASSERT.
	Add definition for __PSTL_ASSERT_MSG.
	* include/pstl/algorithm_impl.h: Replace use of assert().
	* include/pstl/numeric_impl.h: Replace use of assert().
	* include/pstl/parallel_backend_tbb.h:
	Replace use of assert().
	Replace use of __TBB_ASSERT().

	* include/pstl/parallel_backend_utils.h: Replace use of assert().
---
 libstdc++-v3/include/bits/c++config   |  4 
 libstdc++-v3/include/pstl/algorithm_impl.h| 14 +++---
 libstdc++-v3/include/pstl/numeric_impl.h  |  8 
 libstdc++-v3/include/pstl/parallel_backend_tbb.h  | 11 ++-
 .../include/pstl/parallel_backend_utils.h | 15 +++
 5 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 66420a9a3f2..8dd04f218b4 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -690,6 +690,10 @@ namespace std
 #  undef __PSTL_PAR_BACKEND_TBB
 # endif
 
+# define __PSTL_ASSERT(_Condition) (__glibcxx_assert(_Condition))
+# define __PSTL_ASSERT_MSG(_Condition, _Message) (__glibcxx_assert(_Condition))
+
+
 # define __PSTL_PRAGMA(x) _Pragma (#x)
 
 # define __PSTL_STRING_AUX(x) #x
diff --git a/libstdc++-v3/include/pstl/algorithm_impl.h b/libstdc++-v3/include/pstl/algorithm_impl.h
index e06bf60151e..a42d3993d1b 100644
--- a/libstdc++-v3/include/pstl/algorithm_impl.h
+++ b/libstdc++-v3/include/pstl/algorithm_impl.h
@@ -1309,7 +1309,7 @@ __pattern_unique_copy(_ExecutionPolicy&& __exec, _RandomAccessIterator __first,
 return __internal::__except_handler([&__exec, __n, __first, __result, __pred, __is_vector, &__mask_buf]() {
 bool* __mask = __mask_buf.get();
 _DifferenceType __m{};
-__par_backend::parallel_strict_scan(
+__par_backend::__parallel_strict_scan(
 std::forward<_ExecutionPolicy>(__exec), __n, _DifferenceType(0),
 [=](_DifferenceType __i, _DifferenceType __len) -> _DifferenceType { // Reduce
 _DifferenceType __extra = 0;
@@ -2731,8 +2731,8 @@ __pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _Forwa
  return !__internal::__parallel_or(
 std::forward<_ExecutionPolicy>(__exec), __first2, __last2,
 [__first1, __last1, __first2, __last2, &__comp](_ForwardIterator2 __i, _ForwardIterator2 __j) {
-assert(__j > __i);
-//assert(__j - __i > 1);
+__PSTL_ASSERT(__j > __i);
+//__PSTL_ASSERT(__j - __i > 1);
 
 //1. moving boundaries to "consume" subsequence of equal elements
 auto __is_equal = [&__comp](_ForwardIterator2 __a, _ForwardIterator2 __b) -> bool {
@@ -2756,8 +2756,8 @@ __pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _Forwa
 //2. testing is __a subsequence of the second range included into the first range
 auto __b = std::lower_bound(__first1, __last1, *__i, __comp);
 
-assert(!__comp(*(__last1 - 1), *__b));
-assert(!__comp(*(__j - 1), *__i));
+__PSTL_ASSERT(!__comp(*(__last1 - 1), *__b));
+__PSTL_ASSERT(!__comp(*(__j - 1), *__i));
 return !std::includes(__b, __last1, __i, __j, __comp);
 });
 });
@@ -2801,7 +2801,7 @@ __parallel_set_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _Forwar
 __internal::__brick_move(__buffer + __s.__buf_pos, __buffer + (__s.__buf_pos + __s.__len), __result + __s.__pos,
  __is_vector);
 };
-__par_backend::parallel_strict_scan(
+__par_backend::__parallel_strict_scan(
 std::forward<_ExecutionPolicy>(__exec), __n1, _SetRange{0, 0, 0}, //-1, 0},
 [=](_DifferenceType __i, _DifferenceType __len) { // Reduce
 //[__b; __e) - a subrange of the first sequence, to reduce
@@ -2948,7 +2948,7 @@ __parallel_set_union_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _
 }
 
 const auto __m2 = __left_bound_seq_2 - __first2;
-assert(__m1 == 0 || __m2 == 0);
+__PSTL_ASSERT(__m1 == 0 || __m2 == 0);
 if (__m2 > __set_algo_cut_off)
 {
 auto __res_or = __result;
diff --git a/libstdc++-v3/include/pstl/numeric_impl.h b/libstdc++-v3/include/pstl/numeric_impl.h
index 49a4abf5a95..86f8ddf36a3 

Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-01 Thread Thomas Rodgers
>> We shouldn't include  in the std::lib, the uses of assert
>> should be changed to __glibcxx_assert instead (which is enabled by
>> defining _GLIBCXX_ASSERTIONS).
>>
>
> This has to come through one of the PSTL library configuration
> macros because the "right assert" upstream won't be __glibcxx_assert.

There are a number of locations in the upstream PSTL sources where
 is included and assert() is used. Additionally, the TBB
backend uses __TBB_ASSERT(). I'm going to follow up with a separate
patch that introduces __PSTL_ASSERT() and makes everything consistent,
with __PSTL_ASSERT expanding to __glibcxx_assert in libstdc++.

Tom.

Thomas Rodgers writes:

> Jonathan Wakely writes:
>
>> On 29/03/19 12:12 -0700, Thomas Rodgers wrote:
>>>Prevent ADL related weirdness.
>>>
>>> * include/pstl/algorithm_impl.h: Add namespace qualification.
>>> * include/pstl/execution_defs.h: Add namespace qualification.
>>> * include/pstl/execution_impl.h: Add namespace qualification.
>>> * include/pstl/numeric_impl.h: Add namespace qualification.
>>> * include/pstl/parallel_backend_tbb.h: Add namespace qualification.
>>> * include/pstl/unseq_backend_simd.h: Add namespace qualification.
>>> * include/pstl/parallel_backend_utils.h: Include .
>>
>> We shouldn't include  in the std::lib, the uses of assert
>> should be changed to __glibcxx_assert instead (which is enabled by
>> defining _GLIBCXX_ASSERTIONS).
>>
>
> This has to come through one of the PSTL library configuration
> macros because the "right assert" upstream won't be __glibcxx_assert.
>
>>>@@ -285,7 +286,7 @@ _ForwardIterator2
>>> __pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size n, 
>>> _ForwardIterator2 __first2, _Function f,
>>>   _IsVector is_vector, /*parallel=*/std::false_type) 
>>> noexcept
>>
>> I missed these before, but we have non-uglified 'n' and 'f' and
>> 'is_vector' here. Almost all uses of "is_vector" are inside a comment
>> like /*is_vector=*/ but here it's a real parameter name.
>>
>> In practice if users do something stupid like
>> #define n 123
>> #define f 456
>> then they won't be able to include these headers anyway, because
>> TBB uses those as parameter names (so users that are using these
>> headers with TBB can't defines such dumb macros). But when we get a
>> non-TBB backend that won't be the case, and we should be uglifying all
>> names declared in our own headers on principle.
>>
>>> {
>>>-return __brick_walk2_n(__first1, n, __first2, f, is_vector);
>>>+return __internal::__brick_walk2_n(__first1, n, __first2, f, is_vector);
>>> }
>>>
>>> template >> _Size, class _RandomAccessIterator2,
>>>@@ -294,7 +295,7 @@ _RandomAccessIterator2
>>> __pattern_walk2_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 
>>> __first1, _Size n, _RandomAccessIterator2 __first2,
>>>   _Function f, _IsVector is_vector, 
>>> /*parallel=*/std::true_type)
>>
>> And 'n' and 'f' here.
>>
>>> {
>>>-return __pattern_walk2(std::forward<_ExecutionPolicy>(__exec), 
>>>__first1, __first1 + n, __first2, f, is_vector,
>>>+return 
>>>__internal::__pattern_walk2(std::forward<_ExecutionPolicy>(__exec), 
>>>__first1, __first1 + n, __first2, f, is_vector,
>>>std::true_type());
>>> }
>>>
>>
>> We can fix the 'n' and 'f' and 'is_vector' names in another patch, for
>> this one please just remove  again and change assert(...) to
>> __glibcxx_assert(...).



Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-01 Thread Thomas Rodgers


Jonathan Wakely writes:

> On 29/03/19 12:12 -0700, Thomas Rodgers wrote:
>>Prevent ADL related weirdness.
>>
>>  * include/pstl/algorithm_impl.h: Add namespace qualification.
>>  * include/pstl/execution_defs.h: Add namespace qualification.
>>  * include/pstl/execution_impl.h: Add namespace qualification.
>>  * include/pstl/numeric_impl.h: Add namespace qualification.
>>  * include/pstl/parallel_backend_tbb.h: Add namespace qualification.
>>  * include/pstl/unseq_backend_simd.h: Add namespace qualification.
>>  * include/pstl/parallel_backend_utils.h: Include .
>
> We shouldn't include  in the std::lib, the uses of assert
> should be changed to __glibcxx_assert instead (which is enabled by
> defining _GLIBCXX_ASSERTIONS).
>

This has to come through one of the PSTL library configuration
macros because the "right assert" upstream won't be __glibcxx_assert.

>>@@ -285,7 +286,7 @@ _ForwardIterator2
>> __pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size n, 
>> _ForwardIterator2 __first2, _Function f,
>>   _IsVector is_vector, /*parallel=*/std::false_type) noexcept
>
> I missed these before, but we have non-uglified 'n' and 'f' and
> 'is_vector' here. Almost all uses of "is_vector" are inside a comment
> like /*is_vector=*/ but here it's a real parameter name.
>
> In practice if users do something stupid like
> #define n 123
> #define f 456
> then they won't be able to include these headers anyway, because
> TBB uses those as parameter names (so users that are using these
> headers with TBB can't defines such dumb macros). But when we get a
> non-TBB backend that won't be the case, and we should be uglifying all
> names declared in our own headers on principle.
>
>> {
>>-return __brick_walk2_n(__first1, n, __first2, f, is_vector);
>>+return __internal::__brick_walk2_n(__first1, n, __first2, f, is_vector);
>> }
>>
>> template > class _RandomAccessIterator2,
>>@@ -294,7 +295,7 @@ _RandomAccessIterator2
>> __pattern_walk2_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 
>> __first1, _Size n, _RandomAccessIterator2 __first2,
>>   _Function f, _IsVector is_vector, 
>> /*parallel=*/std::true_type)
>
> And 'n' and 'f' here.
>
>> {
>>-return __pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first1, 
>>__first1 + n, __first2, f, is_vector,
>>+return 
>>__internal::__pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first1, 
>>__first1 + n, __first2, f, is_vector,
>>std::true_type());
>> }
>>
>
> We can fix the 'n' and 'f' and 'is_vector' names in another patch, for
> this one please just remove  again and change assert(...) to
> __glibcxx_assert(...).



Re: [PATCH] Add PSTL internal namespace qualifications

2019-04-01 Thread Jonathan Wakely

On 29/03/19 12:12 -0700, Thomas Rodgers wrote:

Prevent ADL related weirdness.

* include/pstl/algorithm_impl.h: Add namespace qualification.
* include/pstl/execution_defs.h: Add namespace qualification.
* include/pstl/execution_impl.h: Add namespace qualification.
* include/pstl/numeric_impl.h: Add namespace qualification.
* include/pstl/parallel_backend_tbb.h: Add namespace qualification.
* include/pstl/unseq_backend_simd.h: Add namespace qualification.
* include/pstl/parallel_backend_utils.h: Include .


We shouldn't include  in the std::lib, the uses of assert
should be changed to __glibcxx_assert instead (which is enabled by
defining _GLIBCXX_ASSERTIONS).


@@ -285,7 +286,7 @@ _ForwardIterator2
__pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size n, 
_ForwardIterator2 __first2, _Function f,
  _IsVector is_vector, /*parallel=*/std::false_type) noexcept


I missed these before, but we have non-uglified 'n' and 'f' and
'is_vector' here. Almost all uses of "is_vector" are inside a comment
like /*is_vector=*/ but here it's a real parameter name.

In practice if users do something stupid like
#define n 123
#define f 456
then they won't be able to include these headers anyway, because
TBB uses those as parameter names (so users that are using these
headers with TBB can't defines such dumb macros). But when we get a
non-TBB backend that won't be the case, and we should be uglifying all
names declared in our own headers on principle.


{
-return __brick_walk2_n(__first1, n, __first2, f, is_vector);
+return __internal::__brick_walk2_n(__first1, n, __first2, f, is_vector);
}

template 

And 'n' and 'f' here.


{
-return __pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first1, 
__first1 + n, __first2, f, is_vector,
+return __internal::__pattern_walk2(std::forward<_ExecutionPolicy>(__exec), 
__first1, __first1 + n, __first2, f, is_vector,
   std::true_type());
}



We can fix the 'n' and 'f' and 'is_vector' names in another patch, for
this one please just remove  again and change assert(...) to
__glibcxx_assert(...).




[PATCH] Add PSTL internal namespace qualifications

2019-03-29 Thread Thomas Rodgers
This patch adds additional internal namespace qualifications to the pstl
implementation.

>From 35dba02035ebb5fd44ac0f06e25a81dfef05898f Mon Sep 17 00:00:00 2001
From: Thomas Rodgers 
Date: Thu, 28 Mar 2019 17:23:49 -0700
Subject: [PATCH] Add namespace qualification for pstl-internal symbols

Prevent ADL related weirdness.

	* include/pstl/algorithm_impl.h: Add namespace qualification.
	* include/pstl/execution_defs.h: Add namespace qualification.
	* include/pstl/execution_impl.h: Add namespace qualification.
	* include/pstl/numeric_impl.h: Add namespace qualification.
	* include/pstl/parallel_backend_tbb.h: Add namespace qualification.
	* include/pstl/unseq_backend_simd.h: Add namespace qualification.
	* include/pstl/parallel_backend_utils.h: Include .
---
 libstdc++-v3/include/pstl/algorithm_impl.h| 427 +-
 libstdc++-v3/include/pstl/execution_defs.h|  10 +-
 libstdc++-v3/include/pstl/execution_impl.h|  22 +-
 libstdc++-v3/include/pstl/numeric_impl.h  |  30 +-
 .../include/pstl/parallel_backend_tbb.h   |  49 +-
 .../include/pstl/parallel_backend_utils.h |   1 +
 .../include/pstl/unseq_backend_simd.h |   8 +-
 7 files changed, 275 insertions(+), 272 deletions(-)

diff --git a/libstdc++-v3/include/pstl/algorithm_impl.h b/libstdc++-v3/include/pstl/algorithm_impl.h
index 9d8242873ab..e06bf60151e 100644
--- a/libstdc++-v3/include/pstl/algorithm_impl.h
+++ b/libstdc++-v3/include/pstl/algorithm_impl.h
@@ -18,6 +18,7 @@
 
 #include "execution_impl.h"
 #include "memory_impl.h"
+#include "parallel_backend_utils.h"
 #include "unseq_backend_simd.h"
 
 #if __PSTL_USE_PAR_POLICIES
@@ -55,7 +56,7 @@ bool
 __pattern_any_of(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
  _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
 {
-return __brick_any_of(__first, __last, __pred, __is_vector);
+return __internal::__brick_any_of(__first, __last, __pred, __is_vector);
 }
 
 #if __PSTL_USE_PAR_POLICIES
@@ -64,10 +65,10 @@ bool
 __pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
  _IsVector __is_vector, /*parallel=*/std::true_type)
 {
-return __except_handler([&]() {
-return __parallel_or(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+return __internal::__except_handler([&]() {
+   return __internal::__parallel_or(std::forward<_ExecutionPolicy>(__exec), __first, __last,
  [__pred, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- return __brick_any_of(__i, __j, __pred, __is_vector);
+ return __internal::__brick_any_of(__i, __j, __pred, __is_vector);
  });
 });
 }
@@ -111,7 +112,7 @@ __pattern_walk1(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator _
 _IsVector __is_vector,
 /*parallel=*/std::false_type) noexcept
 {
-__brick_walk1(__first, __last, __f, __is_vector);
+__internal::__brick_walk1(__first, __last, __f, __is_vector);
 }
 
 #if __PSTL_USE_PAR_POLICIES
@@ -121,10 +122,10 @@ __pattern_walk1(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIte
 _IsVector __is_vector,
 /*parallel=*/std::true_type)
 {
-__except_handler([&]() {
+__internal::__except_handler([&]() {
 __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
   [__f, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
-  __brick_walk1(__i, __j, __f, __is_vector);
+  __internal::__brick_walk1(__i, __j, __f, __is_vector);
   });
 });
 }
@@ -144,7 +145,7 @@ void
 __pattern_walk_brick(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Brick __brick,
  /*parallel=*/std::true_type)
 {
-__except_handler([&]() {
+__internal::__except_handler([&]() {
 __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
   [__brick](_ForwardIterator __i, _ForwardIterator __j) { __brick(__i, __j); });
 });
@@ -158,7 +159,7 @@ template 
 _ForwardIterator
 __brick_walk1_n(_ForwardIterator __first, _Size __n, _Function __f, /*_IsVectorTag=*/std::false_type)
 {
-return __for_each_n_it_serial(__first, __n,
+return __internal::__for_each_n_it_serial(__first, __n,
   [&__f](_ForwardIterator __it) { __f(*__it); }); // calling serial version
 }
 
@@ -175,7 +176,7 @@ _ForwardIterator
 __pattern_walk1_n(_ExecutionPolicy&&, _ForwardIterator __first, _Size __n, _Function __f, _IsVector __is_vector,
   /*is_parallel=*/std::false_type) noexcept
 {
-return