Template Class ReductionResult¶
Defined in File reducer.hpp
Class Documentation¶
-
template<typename
T>
classripple::ReductionResult¶ This class holds the result of a reduction over data of type T.
It stores an atomic type T and a boolean which spcifies if the reduction is complete. It is used to perform a reduction across multiple devices.
- Template Parameters
T: The type of the data for the reduction.
Public Functions
-
ReductionResult() noexcept = default¶ Default constructor, set the results to be unfinished and the value to be zero.
-
ReductionResult(const T &value) noexcept¶ Constructor to initialize the result to the given value.
- Parameters
value: The value to set the result to.
-
auto
value() const noexcept -> T¶ Gets the result of the redution.
- Note
If a call to
finished()returns false, then the result of this call is undefined.- Return
The value of the reduction result.
-
auto
value_and_reset() noexcept -> T¶ Gets the result of the redution and then resets the value of the result to be the initial value.
- Note
If a call to
finished()returns false, then the result of this call is undefined.- Return
The value of the reduction result.
-
auto
reset() noexcept -> void¶ Resets the reduction result to the initial value, and for the refuction result to not be finished.
-
auto
set_value(const T &value) noexcept -> void¶ Sets the result to the given value.
- Parameters
value: The value to set the result to.
-
auto
finished() const noexcept -> bool¶ Determines if the reduction is finished and hence if the value is valid.
- Return
true if threduction is finished and the value is valid.
-
auto
set_finished() noexcept -> void¶ Sets that the reduction is finished.
-
auto
set_unfinished() noexcept -> void¶ Sets the the reduction is not finished.