LAnd
#
Specific implementation of ReducerConcept performing logical AND
operation
Header File: <Kokkos_Core.hpp>
Usage#
T result;
parallel_reduce(N,Functor,LAnd<T,S>(result));
Synopsis#
template<class Scalar, class Space>
class LAnd{
public:
typedef LAnd reducer;
typedef typename std::remove_cv<Scalar>::type value_type;
typedef Kokkos::View<value_type, Space> result_view_type;
KOKKOS_INLINE_FUNCTION
void join(value_type& dest, const value_type& src) const;
KOKKOS_INLINE_FUNCTION
void init(value_type& val) const;
KOKKOS_INLINE_FUNCTION
value_type& reference() const;
KOKKOS_INLINE_FUNCTION
result_view_type view() const;
KOKKOS_INLINE_FUNCTION
LAnd(value_type& value_);
KOKKOS_INLINE_FUNCTION
LAnd(const result_view_type& value_);
};
Interface#
-
template<class Scalar, class Space>
class LAnd# Public Types
-
reducer#
The self type
-
value_type#
The reduction scalar type.
-
result_view_type#
A
Kokkos::View
referencing the reduction result
Constructors
-
KOKKOS_INLINE_FUNCTION LAnd(value_type &value_);#
Constructs a reducer which references a local variable as its result location.
-
KOKKOS_INLINE_FUNCTION LAnd(const result_view_type &value_);#
Constructs a reducer which references a specific view as its result location.
Public Member Functions
-
KOKKOS_INLINE_FUNCTION void join(value_type &dest, const value_type &src) const;#
Store logical
and
ofsrc
anddest
intodest
:dest = src && dest;
.
-
KOKKOS_INLINE_FUNCTION void init(value_type &val) const;#
Initialize
val
using theKokkos::reduction_identity<Scalar>::land()
method. The default implementation setsval=1
.
-
KOKKOS_INLINE_FUNCTION value_type &reference() const;#
Returns a reference to the result provided in class constructor.
-
KOKKOS_INLINE_FUNCTION result_view_type view() const;#
Returns a view of the result place provided in class constructor.
-
reducer#
Additional Information#
LAnd<T,S>::value_type
is non-constT
LAnd<T,S>::result_view_type
isKokkos::View<T,S,Kokkos::MemoryTraits<Kokkos::Unmanaged>>
. Note that the S (memory space) must be the same as the space where the result resides.Requires:
Scalar
hasoperator =
andoperator &&
defined.Kokkos::reduction_identity<Scalar>::land()
is a valid expression.In order to use LAnd 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