[pstl] A hot fix for a reduction parallel pattern of OpenMP backend
Reviewed By: nadiasvertex, ldionne Differential Revision: https://reviews.llvm.org/D112125
This commit is contained in:
parent
64d1617d18
commit
8f5cb64c71
|
@ -23,6 +23,11 @@ _Value
|
|||
__parallel_reduce_body(_RandomAccessIterator __first, _RandomAccessIterator __last, _Value __identity,
|
||||
_RealBody __real_body, _Reduction __reduce)
|
||||
{
|
||||
if (__should_run_serial(__first, __last))
|
||||
{
|
||||
return __real_body(__first, __last, __identity);
|
||||
}
|
||||
|
||||
auto __middle = __first + ((__last - __first) / 2);
|
||||
_Value __v1(__identity), __v2(__identity);
|
||||
__parallel_invoke_body(
|
||||
|
|
Loading…
Reference in New Issue