Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#120: API-core-builtinreducers-LAnd from md to rst #278

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions docs/source/API/core/builtinreducers/LAnd.md

This file was deleted.

97 changes: 97 additions & 0 deletions docs/source/API/core/builtinreducers/LAnd.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
``LAnd``
========

.. role:: cppkokkos(code)
:language: cppkokkos

Specific implementation of `ReducerConcept <ReducerConcept.html>`_ performing logical ``AND`` operation

Header File: ``<Kokkos_Core.hpp>``

Usage
-----

.. code-block:: cpp

T result;
parallel_reduce(N,Functor,LAnd<T,S>(result));

Synopsis
--------

.. code-block:: cpp

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_);
};


Public Class Members
--------------------

Typedefs
~~~~~~~~

* ``reducer``: The self type.
* ``value_type``: The reduction scalar type.
* ``result_view_type``: A ``Kokkos::View`` referencing the reduction result

Constructors
~~~~~~~~~~~~

.. cppkokkos:kokkosinlinefunction:: LAnd(value_type& value_);

* Constructs a reducer which references a local variable as its result location.

.. cppkokkos:kokkosinlinefunction:: LAnd(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 logical ``and`` of ``src`` and ``dest`` into ``dest``: ``dest = src && dest;``.

.. cppkokkos:kokkosinlinefunction:: void init(value_type& val) const;

* Initialize ``val`` using the ``Kokkos::reduction_identity<Scalar>::land()`` method. The default implementation sets ``val=1``.

.. 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
~~~~~~~~~~~~~~~~~~~~~~

* ``LAnd<T,S>::value_type`` is non-const ``T``
* ``LAnd<T,S>::result_view_type`` is ``Kokkos::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`` has ``operator =`` and ``operator &&`` 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 <../../../ProgrammingGuide/Custom-Reductions-Built-In-Reducers-with-Custom-Scalar-Types.html>`_ for details