8 # pragma GCC diagnostic push
9 # pragma GCC diagnostic ignored "-Wpedantic"
11 #include "tbb/parallel_reduce.h"
12 #include "tbb/blocked_range.h"
14 # pragma GCC diagnostic pop
30 RedirStderr (
const RedirStderr&) =
delete;
31 RedirStderr& operator= (
const RedirStderr&) =
delete;
40 RedirStderr::RedirStderr()
42 if (dlsym (RTLD_DEFAULT,
"__ubsan_handle_add_overflow") != NULL) {
43 m_nullfd =
open (
"/dev/null", O_WRONLY);
50 m_nullfd = m_stderr = -1;
56 RedirStderr::~RedirStderr()
72 return tbb::parallel_reduce( tbb::blocked_range<int>( 0, nrepeats, 1 ),
74 [&]( tbb::blocked_range<int>,
bool statusSoFar ) ->
bool {
77 [](
bool allCallsStatus,
bool thisCallStatus ) ->
bool {
78 return allCallsStatus and thisCallStatus;
92 return tbb::parallel_reduce( tbb::blocked_range< std::vector<ParallelCallTest*>::const_iterator >(
tests.begin(),
tests.end() ),
94 [&]( tbb::blocked_range< std::vector<ParallelCallTest*>::const_iterator > groupOfTests,
bool statusSoFar ) ->
bool {
96 for ( auto test : groupOfTests ) {
97 success = test->run( nrepeats ) and success;
99 return statusSoFar and success;
101 [](
bool allCallsStatus,
bool thisCallStatus ) ->
bool {
102 return allCallsStatus and thisCallStatus;