Skip to content

Commit 9447481

Browse files
committed
Missing return statements in fill and for_each
1 parent 67ecdee commit 9447481

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libcxx/include/__algorithm/pstl_backends/gpu_backends/fill.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ __pstl_fill(__gpu_backend_tag, _ForwardIterator __first, _ForwardIterator __last
3636
if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
3737
__has_random_access_iterator_category_or_concept<_ForwardIterator>::value &&
3838
__libcpp_is_contiguous_iterator<_ForwardIterator>::value) {
39-
std::__par_backend::__parallel_for_simd_val_1(__first, __last - __first, __value);
39+
return std::__par_backend::__parallel_for_simd_val_1(__first, __last - __first, __value);
4040
}
4141
// Otherwise, we execute for_each on the CPU instead
4242
return std::__pstl_fill<_ExecutionPolicy>(__cpu_backend_tag{}, __first, __last, __value);

libcxx/include/__algorithm/pstl_backends/gpu_backends/for_each.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ __pstl_for_each(__gpu_backend_tag, _ForwardIterator __first, _ForwardIterator __
3535
if constexpr (__is_unsequenced_execution_policy_v<_ExecutionPolicy> &&
3636
__has_random_access_iterator_category_or_concept<_ForwardIterator>::value &&
3737
__libcpp_is_contiguous_iterator<_ForwardIterator>::value) {
38-
std::__par_backend::__parallel_for_simd_1(__first, __last - __first, __func);
38+
return std::__par_backend::__parallel_for_simd_1(__first, __last - __first, __func);
3939
}
4040
// Else if the excution policy is parallel, we execute for_each on the CPU instead
4141
return std::__pstl_for_each<_ExecutionPolicy>(__cpu_backend_tag{}, __first, __last, __func);

0 commit comments

Comments
 (0)