Skip to content

Commit 3f42fee

Browse files
committed
[libc++][NFC] Rename __simd_walk functions to give more descriptive names
1 parent 9540950 commit 3f42fee

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

libcxx/include/__pstl/cpu_algos/for_each.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
_LIBCPP_BEGIN_NAMESPACE_STD
2929

3030
template <class _Iterator, class _DifferenceType, class _Function>
31-
_LIBCPP_HIDE_FROM_ABI _Iterator __simd_walk(_Iterator __first, _DifferenceType __n, _Function __f) noexcept {
31+
_LIBCPP_HIDE_FROM_ABI _Iterator __simd_for_each(_Iterator __first, _DifferenceType __n, _Function __f) noexcept {
3232
_PSTL_PRAGMA_SIMD
3333
for (_DifferenceType __i = 0; __i < __n; ++__i)
3434
__f(__first[__i]);
@@ -52,7 +52,7 @@ struct __cpu_parallel_for_each {
5252
});
5353
} else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> &&
5454
__has_random_access_iterator_category_or_concept<_ForwardIterator>::value) {
55-
std::__simd_walk(__first, __last - __first, __func);
55+
std::__simd_for_each(__first, __last - __first, __func);
5656
return __empty{};
5757
} else {
5858
std::for_each(__first, __last, __func);

libcxx/include/__pstl/cpu_algos/transform.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3333

3434
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function>
3535
_LIBCPP_HIDE_FROM_ABI _Iterator2
36-
__simd_walk(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept {
36+
__simd_transform(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept {
3737
_PSTL_PRAGMA_SIMD
3838
for (_DifferenceType __i = 0; __i < __n; ++__i)
3939
__f(__first1[__i], __first2[__i]);
4040
return __first2 + __n;
4141
}
4242

43+
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function>
44+
_LIBCPP_HIDE_FROM_ABI _Iterator3 __simd_transform(
45+
_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept {
46+
_PSTL_PRAGMA_SIMD
47+
for (_DifferenceType __i = 0; __i < __n; ++__i)
48+
__f(__first1[__i], __first2[__i], __first3[__i]);
49+
return __first3 + __n;
50+
}
51+
4352
template <class _Backend, class _RawExecutionPolicy>
4453
struct __cpu_parallel_transform {
4554
template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation>
@@ -70,7 +79,7 @@ struct __cpu_parallel_transform {
7079
} else if constexpr (__is_unsequenced_execution_policy_v<_RawExecutionPolicy> &&
7180
__has_random_access_iterator_category_or_concept<_ForwardIterator>::value &&
7281
__has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) {
73-
return std::__simd_walk(
82+
return std::__simd_transform(
7483
__first,
7584
__last - __first,
7685
__result,
@@ -83,15 +92,6 @@ struct __cpu_parallel_transform {
8392
}
8493
};
8594

86-
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function>
87-
_LIBCPP_HIDE_FROM_ABI _Iterator3 __simd_walk(
88-
_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept {
89-
_PSTL_PRAGMA_SIMD
90-
for (_DifferenceType __i = 0; __i < __n; ++__i)
91-
__f(__first1[__i], __first2[__i], __first3[__i]);
92-
return __first3 + __n;
93-
}
94-
9595
template <class _Backend, class _RawExecutionPolicy>
9696
struct __cpu_parallel_transform_binary {
9797
template <class _Policy,
@@ -132,7 +132,7 @@ struct __cpu_parallel_transform_binary {
132132
__has_random_access_iterator_category_or_concept<_ForwardIterator1>::value &&
133133
__has_random_access_iterator_category_or_concept<_ForwardIterator2>::value &&
134134
__has_random_access_iterator_category_or_concept<_ForwardOutIterator>::value) {
135-
return std::__simd_walk(
135+
return std::__simd_transform(
136136
__first1,
137137
__last1 - __first1,
138138
__first2,

0 commit comments

Comments
 (0)