Reducer for "or" (operator|).
More...
#include <Reducer.hpp>
Public Member Functions | |
| Super (ReducerImpl< T, collective_or >) | |
| void | operator|= (const T &v) |
Public Member Functions inherited from ReducerImpl< T, collective_or > | |
| ReducerImpl () | |
| operator T () const | |
| Read out value; does expensive global reduce. More... | |
| void | operator= (const T &v) |
| Globally set the value; expensive global synchronization. More... | |
| void | reset () |
| Globally reset to default value for the type. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ReducerImpl< T, collective_or > | |
| T | local_value |
Reducer for "or" (operator|).
Useful for "any" checks, such as "are any values non-zero?". Provides cheap operator for "or-ing" something onto the value: |=.
Example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reducer<bool,ReducerType::Or> any_nonzero;
// ... (somewhere in main task) any_nonzero = false; forall(A, N, [](double& A_i){ if (A_i != 0) { any_nonzero |= true } }); LOG(INFO) << ( any_nonzero ? "some" : "no" ) << " nonzeroes.";
Definition at line 343 of file Reducer.hpp.
|
inline |
Definition at line 346 of file Reducer.hpp.
| Reducer< T, ReducerType::Or >::Super | ( | ReducerImpl< T, collective_or > | ) |