From e83ede022769a80f671edc528164a82672cc04b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wr=C3=B3bel?= Date: Tue, 8 Nov 2022 12:30:59 +0100 Subject: [PATCH] #120: - API core view LayoutLeft transition from md to rst --- docs/source/API/core/view/layoutLeft.md | 86 ---------------------- docs/source/API/core/view/layoutLeft.rst | 92 ++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 86 deletions(-) delete mode 100644 docs/source/API/core/view/layoutLeft.md create mode 100644 docs/source/API/core/view/layoutLeft.rst diff --git a/docs/source/API/core/view/layoutLeft.md b/docs/source/API/core/view/layoutLeft.md deleted file mode 100644 index 51952d9e9..000000000 --- a/docs/source/API/core/view/layoutLeft.md +++ /dev/null @@ -1,86 +0,0 @@ -# `LayoutLeft` - -Header File: `Kokkos_Layout.hpp` - -This Kokkos Layout, when provided to a multidimensional View, lays out memory such that the first index is the contiguous one. This matches the Fortran conventions for allocations. - -Usage: - -```c++ -Kokkos::View my_view; -``` - -## Synopsis -```c++ -struct LayoutLeft { - -typedef LayoutLeft array_layout; - -size_t dimension[ARRAY_LAYOUT_MAX_RANK]; - -enum { is_extent_constructible = true }; - -LayoutLeft(LayoutLeft const&) = default; -LayoutLeft(LayoutLeft&&) = default; -LayoutLeft& operator=(LayoutLeft const&) = default; -LayoutLeft& operator=(LayoutLeft&&) = default; - -KOKKOS_INLINE_FUNCTION -explicit constexpr LayoutLeft(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, - size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, - size_t N6 = 0, size_t N7 = 0) - : dimension{N0, N1, N2, N3, N4, N5, N6, N7} {} -}; -``` - -## Public Class Members - - * `dimension` - - An array containing the size of each dimension of the Layout - -## Typedefs - - * `array_layout` - - A tag signifying that this models the Layout concept - -## Enums - - * `is_extent_constructible` - - A boolean enum to allow detection that this class is extent constructible - -### Constructors - - * `LayoutLeft(LayoutLeft const&) = default;` - - Default copy constructor, element-wise copies the other Layout - - * `LayoutLeft(LayoutLeft&&) = default;` - - Default move constructor, element-wise moves the other Layout - - * -```c++ -KOKKOS_INLINE_FUNCTION -explicit constexpr LayoutLeft(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, - size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, - size_t N6 = 0, size_t N7 = 0); -``` - - Constructor that takes in up to 8 sizes, to set the sizes of the corresponding dimensions of the Layout - -### Assignment operators - - * `LayoutLeft& operator=(LayoutLeft const&) = default;` - - Default copy assignment, element-wise copies the other Layout - - * `LayoutLeft& operator=(LayoutLeft&&) = default;` - - Default move assignment, element-wise moves the other Layout - -### Functions - - * None diff --git a/docs/source/API/core/view/layoutLeft.rst b/docs/source/API/core/view/layoutLeft.rst new file mode 100644 index 000000000..97d6b8ba8 --- /dev/null +++ b/docs/source/API/core/view/layoutLeft.rst @@ -0,0 +1,92 @@ +``LayoutLeft`` +============== + +.. role:: cpp(code) + :language: cpp + +Header File: ``Kokkos_Layout.hpp`` + +Usage: + +.. code-block:: cpp + + Kokkos::View my_view; + +Synopsis +-------- + +.. code-block:: cpp + + struct LayoutLeft { + + typedef LayoutLeft array_layout; + + size_t dimension[ARRAY_LAYOUT_MAX_RANK]; + + enum { is_extent_constructible = true }; + + LayoutLeft(LayoutLeft const&) = default; + LayoutLeft(LayoutLeft&&) = default; + LayoutLeft& operator=(LayoutLeft const&) = default; + LayoutLeft& operator=(LayoutLeft&&) = default; + + KOKKOS_INLINE_FUNCTION + explicit constexpr LayoutLeft(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, + size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, + size_t N6 = 0, size_t N7 = 0) + : dimension{N0, N1, N2, N3, N4, N5, N6, N7} {} + }; + + +Class Interface +--------------- + +.. cpp:class:: LayoutLeft + + This Kokkos Layout, when provided to a multidimensional View, lays out memory such that the first index is the contiguous one. This matches the Fortran conventions for allocations. + + .. rubric:: Public Member Variables + + .. cpp:member:: static constexpr bool is_extent_constructible + + A boolean enum to allow detection that this class is extent constructible + + .. cpp:member:: static constexpr unsigned dimension + + An array containing the size of each dimension of the Layout + + .. rubric:: Other Types + + .. cpp:type:: array_layout + + A tag signifying that this models the Layout concept + + .. rubric:: Constructors + + .. cpp:function:: LayoutLeft(LayoutLeft const&) + + Default copy constructor, element-wise copies the other Layout + + .. cpp:function:: LayoutLeft(LayoutLeft&&) + + Default move constructor, element-wise moves the other Layout + + .. code-block:: cpp + + KOKKOS_INLINE_FUNCTION + explicit constexpr LayoutLeft(size_t N0 = 0, size_t N1 = 0, size_t N2 = 0, + size_t N3 = 0, size_t N4 = 0, size_t N5 = 0, + size_t N6 = 0, size_t N7 = 0); + + Constructor that takes in up to 8 sizes, to set the sizes of the corresponding dimensions of the Layout + + .. rubric:: Assignment operators + + .. cpp:function:: LayoutLeft& operator=(LayoutLeft const&) = default + + Default copy assignment, element-wise copies the other Layout + + .. cpp:function:: LayoutLeft& operator=(LayoutLeft&&) = default + + Default move assignment, element-wise moves the other Layout +