-
Notifications
You must be signed in to change notification settings - Fork 0
Kokkos::MinLoc
Specific implementation of ReducerConcept storing the minimum value with an index
Header File: Kokkos_Core.hpp
Usage:
MinLoc<T,I,S>::value_type result;
parallel_reduce(N,Functor,MinLoc<T,I,S>(result));
.
template<class Scalar, class Index, class Space>
class MinLoc{
public:
typedef MinLoc reducer;
typedef ValLocScalar<typename std::remove_cv<Scalar>::type,
typename std::remove_cv<Index>::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 join(volatile value_type& dest, const volatile 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
MinLoc(value_type& value_);
KOKKOS_INLINE_FUNCTION
MinLoc(const result_view_type& value_);
};
-
reducer
: The self type. -
value_type
: The reduction scalar type (specialization of ValLocScalar) -
result_view_type
: AKokkos::View
referencing the reduction result
-
MinLoc(value_type& result)
Constructs a reducer which references a local variable as its result location.
-
MinLoc(const result_view_type result)`
Constructs a reducer which references a specific view as its result location.
-
void join(value_type& dest, const value_type& src) const;`
Store minimum with index of
src
anddest
intodest
:dest = (src.val < dest.val) ? src : dest;
. -
void join(volatile value_type& dest, const volatile value_type& src) const;
Store minimum with index of
src
anddest
intodest
:dest = (src.val < dest.val) ? src : dest;
. -
void init( value_type& val) const;
Initialize
val.val
using the Kokkos::reduction_identity::min() method. The default implementation setsval=<TYPE>_MAX
.Initialize
val.loc
using the Kokkos::reduction_identity::min() method. The default implementation setsval=<TYPE>_MAX
. -
value_type& reference() const;
Returns a reference to the result provided in class constructor.
-
result_view_type view() const;
Returns a view of the result place provided in class constructor.
-
MinLoc<T,I,S>::value_type
is Specialization of ValLocScalar on non-constT
and non-constI
-
MinLoc<T,I,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>::min()
is a valid expression. - Requires:
Index
hasoperator =
defined.Kokkos::reduction_identity<Index>::min()
is a valid expression. - In order to use MinLoc with a custom type of either
Scalar
orIndex
, a template specialization of Kokkos::reduction_identity must be defined. See Using Built-in Reducers with Custom Scalar Types for details
Home:
- Introduction
- Machine Model
- Programming Model
- Compiling
- Initialization
- View
- Parallel Dispatch
- Hierarchical Parallelism
- Custom Reductions
- Atomic Operations
- Subviews
- Interoperability
- Kokkos and Virtual Functions
- Initialization and Finalization
- View
- Data Parallelism
- Execution Policies
- Spaces
- Task Parallelism
- Utilities
- STL Compatibility
- Numerics
- Detection Idiom