BOr¶
Specific implementation of ReducerConcept performing bitwise OR operation
Header File: <Kokkos_Core.hpp>
Usage¶
T result;
parallel_reduce(N, Functor, BOr<T, S>(result));
Synopsis¶
template<class Scalar, class Space>
class BOr {
public:
using reducer = BOr<Scalar, Space>;
using value_type = typename std::remove_cv<Scalar>::type;
KOKKOS_INLINE_FUNCTION
void join(value_type& dest, const value_type& src) const {
dest = dest | src;
}
KOKKOS_INLINE_FUNCTION
void init(value_type& val) const {
val = Kokkos::reduction_identity<value_type>::bor();
}
// other members to fulfill the ReducerConcept
};
Interface¶
All the public types, constructors and methods from ReducerConcept are available. The following types and methods are overridden by this reducer:
-
template<class Scalar, class Space>
class BOr¶ Public Types
-
type reducer¶
The self type.
-
type value_type¶
The
Scalartemplate parameter stripped of its potentialconstand/orvolatilequalifier.
Public Member Functions
-
KOKKOS_INLINE_FUNCTION void join(value_type &dest, const value_type &src) const;¶
Store logical
orofsrcanddestintodest:dest = src | dest.
-
KOKKOS_INLINE_FUNCTION void init(value_type &val) const;¶
Initialize
valusing theKokkos::reduction_identity<value_type>::bor()method. The default implementation setsval=0x0.
-
type reducer¶
Additional Information¶
Requires:
value_typehasoperator =andoperator |defined.Kokkos::reduction_identity<value_type>::bor()is a valid expression.In order to use
BOrwith a custom type, a template specialization ofKokkos::reduction_identity<CustomType>must be defined. See Built-In Reducers with Custom Scalar Types for details