Skip to content

Commit

Permalink
finalize, fix indentation of arguments in code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Mar 10, 2023
1 parent aea477b commit 6c839ec
Showing 1 changed file with 69 additions and 58 deletions.
127 changes: 69 additions & 58 deletions docs/source/API/core/view/resize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,73 @@ Reallocates a view to have the new dimensions. Can grow or shrink, and will pres
Description
-----------

.. cppkokkos::function: template <class T, class... P> \
void resize(View<T, P...>& v,\
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);
Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view.
* .. code-block:: cpp

:param v: existing view, can be a default constructed one.
template <class T, class... P>
void resize(View<T, P...>& v,
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);

:param n[X]: new length for extent X.
Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view.

Restrictions: ``View<T, P...>::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``.
* ``v``: existing view, can be a default constructed one.
* ``n[X]``: new length for extent X.

|
Restrictions:

.. cppkokkos::function: template <class I, class T, class... P> \
void resize(const I& arg_prop, Kokkos::View<T, P...>& v, \
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,\
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);
* ``View<T, P...>::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``.

Resizes ``v`` to have the new dimensions while preserving the contents for the
common subview of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor property ``arg_prop``, e.g., Kokkos::WithoutInitializing.
* .. code-block:: cpp

:param v: existing view, can be a default constructed one.
template <class I, class T, class... P>
void resize(const I& arg_prop, Kokkos::View<T, P...>& v,
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);

Resizes ``v`` to have the new dimensions while preserving the contents for the common
subview of the old and new view. The new ``Kokkos::View`` is constructed using the
View constructor property ``arg_prop``, e.g., Kokkos::WithoutInitializing.

:param n[X]: new length for extent X.
* ``v``: existing view, can be a default constructed one.

:param arg_prop: View constructor property, e.g., ``Kokkos::WithoutInitializing``.
* ``n[X]``: new length for extent X.

Restrictions: ``View<T, P...>::array_layout`` is either ``LayoutLeft` or `LayoutRight``.
* ``arg_prop``: View constructor property, e.g., ``Kokkos::WithoutInitializing``.

|
Restrictions:

* ``View<T, P...>::array_layout`` is either ``LayoutLeft` or `LayoutRight``.

* .. code-block:: cpp

template <class T, class... P, class... ViewCtorArgs>
void resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
Kokkos::View<T, P...>& v,
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);

Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor properties ``arg_prop``, e.g., ``Kokkos::view_alloc(Kokkos::WithoutInitializing)``. If ``arg_prop`` includes an execution space, it is used for allocating memory and for copying elements without using a final fence.
template <class T, class... P, class... ViewCtorArgs>
void resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
Kokkos::View<T, P...>& v,
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG);

Resizes ``v`` to have the new dimensions while preserving the contents for the common
subview of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor
properties ``arg_prop``, e.g., ``Kokkos::view_alloc(Kokkos::WithoutInitializing)``.
If ``arg_prop`` includes an execution space, it is used for allocating memory and for copying elements without using a final fence.

* ``v``: existing view, can be a default constructed one.
* ``n[X]``: new length for extent X.
Expand All @@ -93,9 +99,9 @@ Description

* .. code-block:: cpp

template <class T, class... P>
void resize(Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);
template <class T, class... P>
void resize(Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);

Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view.

Expand All @@ -104,24 +110,29 @@ Description

* .. code-block:: cpp

template <class T, class... P>
void resize(const I& arg_prop, Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);
template <class T, class... P>
void resize(const I& arg_prop, Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);

Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor property ``arg_prop``, e.g., Kokkos::WithoutInitializing.
Resizes ``v`` to have the new dimensions while preserving the contents for the common subview
of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor
property ``arg_prop``, e.g., Kokkos::WithoutInitializing.

* ``v``: existing view, can be a default constructed one.
* ``layout``: a layout instance containing the new dimensions.
* ``arg_prop``: View constructor property, e.g., ``Kokkos::WithoutInitializing``.

* .. code-block:: cpp

template <class T, class... P, class... ViewCtorArgs>
void resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);
template <class T, class... P, class... ViewCtorArgs>
void resize(const Impl::ViewCtorProp<ViewCtorArgs...>& arg_prop,
Kokkos::View<T, P...>& v,
const typename Kokkos::View<T, P...>::array_layout& layout);

Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view. The new ``Kokkos::View`` is constructed using the View constructor properties ``arg_prop``, e.g., ``Kokkos::view_alloc(Kokkos::WithoutInitializing)``. If ``arg_prop`` includes an execution space, it is used for allocating memory and for copying elements without using a final fence.
Resizes ``v`` to have the new dimensions while preserving the contents for the
common subview of the old and new view. The new ``Kokkos::View`` is constructed using
the View constructor properties ``arg_prop``, e.g., ``Kokkos::view_alloc(Kokkos::WithoutInitializing)``.
If ``arg_prop`` includes an execution space, it is used for allocating memory and for copying elements without using a final fence.

* ``v``: existing view, can be a default constructed one.
* ``layout``: a layout instance containing the new dimensions.
Expand Down

0 comments on commit 6c839ec

Please sign in to comment.