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 Scalar template parameter stripped of its potential const and/or volatile qualifier.

Public Member Functions

KOKKOS_INLINE_FUNCTION void join(value_type &dest, const value_type &src) const;

Store logical or of src and dest into dest: dest = src | dest.

KOKKOS_INLINE_FUNCTION void init(value_type &val) const;

Initialize val using the Kokkos::reduction_identity<value_type>::bor() method. The default implementation sets val=0x0.

Additional Information

  • Requires: value_type has operator = and operator | defined. Kokkos::reduction_identity<value_type>::bor() is a valid expression.

  • In order to use BOr with a custom type, a template specialization of Kokkos::reduction_identity<CustomType> must be defined. See Built-In Reducers with Custom Scalar Types for details