diff --git a/docs/source/API/core/builtinreducers/MaxLoc.md b/docs/source/API/core/builtinreducers/MaxLoc.md deleted file mode 100644 index 0cc5dbb37..000000000 --- a/docs/source/API/core/builtinreducers/MaxLoc.md +++ /dev/null @@ -1,92 +0,0 @@ -# `MaxLoc` - -Specific implementation of [ReducerConcept](ReducerConcept) storing the maximum value - -Header File: `Kokkos_Core.hpp` - -Usage: -```c++ -MaxLoc::value_type result; -parallel_reduce(N,Functor,MaxLoc(result)); -``` - -## Synopsis -```c++ -template -class MaxLoc{ - public: - typedef MaxLoc reducer; - typedef ValLocScalar::type, - typename std::remove_cv::type > value_type; - typedef Kokkos::View 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 - MaxLoc(value_type& value_); - - KOKKOS_INLINE_FUNCTION - MaxLoc(const result_view_type& value_); -}; -``` - -## Public Class Members - -### Typedefs - - * `reducer`: The self type. - * `value_type`: The reduction scalar type (specialization of [ValLocScalar](ValLocScalar)) - * `result_view_type`: A `Kokkos::View` referencing the reduction result - -### Constructors - - * ```c++ - MaxLoc(value_type& result) - ``` - Constructs a reducer which references a local variable as its result location. - - * ```c++ - MaxLoc(const result_view_type result) - ``` - Constructs a reducer which references a specific view as its result location. - -### Functions - - * ```c++ - void join(value_type& dest, const value_type& src) const; - ``` - Store maximum with index of `src` and `dest` into `dest`: `dest = (src.val > dest.val) ? src : dest;`. - - * ```c++ - void init( value_type& val) const; - ``` - Initialize `val.val` using the Kokkos::reduction_identity::max() method. The default implementation sets `val=_MIN`. - - Initialize `val.loc` using the Kokkos::reduction_identity::min() method. The default implementation sets `val=_MAX`. - - * ```c++ - value_type& reference() const; - ``` - Returns a reference to the result provided in class constructor. - - * ```c++ - result_view_type view() const; - ``` - Returns a view of the result place provided in class constructor. - -### Additional Information - * `MaxLoc::value_type` is Specialization of ValLocScalar on non-const `T` and non-const `I` - * `MaxLoc::result_view_type` is `Kokkos::View>`. Note that the S (memory space) must be the same as the space where the result resides. - * Requires: `Scalar` has `operator =` and `operator >` defined. `Kokkos::reduction_identity::max()` is a valid expression. - * Requires: `Index` has `operator =` defined. `Kokkos::reduction_identity::min()` is a valid expression. - * In order to use MaxLoc with a custom type of either `Scalar` or `Index`, a template specialization of `Kokkos::reduction_identity` must be defined. See [Built-In Reducers with Custom Scalar Types](../../../ProgrammingGuide/Custom-Reductions-Built-In-Reducers-with-Custom-Scalar-Types) for details diff --git a/docs/source/API/core/builtinreducers/MaxLoc.rst b/docs/source/API/core/builtinreducers/MaxLoc.rst new file mode 100644 index 000000000..e0f40be89 --- /dev/null +++ b/docs/source/API/core/builtinreducers/MaxLoc.rst @@ -0,0 +1,99 @@ +``MaxLoc`` +========= + +.. role:: cppkokkos(code) + :language: cppkokkos + +Specific implementation of `ReducerConcept `_ storing the maximum value + +Header File: ```` + +Usage +----- + +.. code-block:: cpp + + MaxLoc::value_type result; + parallel_reduce(N,Functor,MaxLoc(result)); + +Synopsis +-------- + +.. code-block:: cpp + + template + class MaxLoc{ + public: + typedef MaxLoc reducer; + typedef ValLocScalar::type, + typename std::remove_cv::type > value_type; + typedef Kokkos::View 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 + MaxLoc(value_type& value_); + + KOKKOS_INLINE_FUNCTION + MaxLoc(const result_view_type& value_); + }; + +Public Class Members +-------------------- + +Typedefs +~~~~~~~~ + +* ``reducer``: The self type. +* ``value_type``: The reduction scalar type (specialization of `ValLocScalar `_) +* ``result_view_type``: A ``Kokkos::View`` referencing the reduction result + +Constructors +~~~~~~~~~~~~ + +.. cppkokkos:kokkosinlinefunction:: MaxLoc(value_type& value_); + + * Constructs a reducer which references a local variable as its result location. + +.. cppkokkos:kokkosinlinefunction:: MaxLoc(const result_view_type& value_); + + * Constructs a reducer which references a specific view as its result location. + +Functions +~~~~~~~~~ + +.. cppkokkos:kokkosinlinefunction:: void join(value_type& dest, const value_type& src) const; + + * Store maximum with index of ``src`` and ``dest`` into ``dest``: ``dest = (src.val > dest.val) ? src :dest;``. + +.. cppkokkos:kokkosinlinefunction:: void init(value_type& val) const; + + * Initialize ``val.val`` using the ``Kokkos::reduction_identity::max()`` method. The default implementation sets ``val=_MIN``. + * Initialize ``val.loc`` using the ``Kokkos::reduction_identity::min()`` method. The default implementation sets ``val=_MAX``. + +.. cppkokkos:kokkosinlinefunction:: value_type& reference() const; + + * Returns a reference to the result provided in class constructor. + +.. cppkokkos:kokkosinlinefunction:: result_view_type view() const; + + * Returns a view of the result place provided in class constructor. + +Additional Information +~~~~~~~~~~~~~~~~~~~~~~ + +* ``MaxLoc::value_type`` is Specialization of ValLocScalar on non-const ``T`` and non-const ``I`` +* ``MaxLoc::result_view_type`` is ``Kokkos::View>``. Note that the S (memory space) must be the same as the space where the result resides. +* Requires: ``Scalar`` has ``operator =`` and ``operator >`` defined. ``Kokkos::reduction_identity::max()`` is a valid expression. +* Requires: ``Index`` has ``operator =`` defined. ``Kokkos::reduction_identity::min()`` is a valid expression. +* In order to use MaxLoc with a custom type of either ``Scalar`` or ``Index``, a template specialization of ``Kokkos::reduction_identity`` must be defined. See `Built-In Reducers with Custom Scalar Types <../../../ProgrammingGuide/Custom-Reductions-Built-In-Reducers-with-Custom-Scalar-Types.html>`_ for details