diff --git a/docs/source/API/alphabetical.rst b/docs/source/API/alphabetical.rst index 9b629a917..857dfae78 100644 --- a/docs/source/API/alphabetical.rst +++ b/docs/source/API/alphabetical.rst @@ -118,7 +118,7 @@ Core +--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | `initialize `_ | `Core `_ | `Initialization and Finalization `_ | function to initialize Kokkos | +--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ -| `is_array_layout `_ | `Core `_ | `Traits `_ | Trait to detect types that model the Layout concept | +| `is_layout_type `_ | `Core `_ | `Traits `_ | Trait to detect types that model the Layout concept | +--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | `is_execution_policy `_ | `Core `_ | `Traits `_ | Trait to detect types that model ExecutionPolicy concept | +--------------------------------------------------------------------------------------+---------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/docs/source/API/containers/DualView.rst b/docs/source/API/containers/DualView.rst index d153b5a81..af898eeb5 100644 --- a/docs/source/API/containers/DualView.rst +++ b/docs/source/API/containers/DualView.rst @@ -84,7 +84,7 @@ Description The type of a const View host mirror of ``t_dev_const``. - .. cpp:type:: View > t_dev_const_randomread + .. cpp:type:: View > t_dev_const_randomread The type of a const, random-access View on the device. @@ -92,23 +92,23 @@ Description The type of a const, random-access View host mirror of ``t_dev_const_randomread``. - .. cpp:type:: View t_dev_um + .. cpp:type:: View t_dev_um The type of an unmanaged View on the device. - .. cpp:type:: View t_host_um + .. cpp:type:: View t_host_um The type of an unmanaged View host mirror of \\c t_dev_um. - .. cpp:type:: View t_dev_const_um + .. cpp:type:: View t_dev_const_um The type of a const unmanaged View on the device. - .. cpp:type:: View t_host_const_um + .. cpp:type:: View t_host_const_um The type of a const unmanaged View host mirror of \\c t_dev_const_um. - .. cpp:type:: View > t_dev_const_randomread_um + .. cpp:type:: View > t_dev_const_randomread_um The type of a const, random-access View on the device. diff --git a/docs/source/API/containers/DynRankView.rst b/docs/source/API/containers/DynRankView.rst index 845693527..7cc0c79cc 100644 --- a/docs/source/API/containers/DynRankView.rst +++ b/docs/source/API/containers/DynRankView.rst @@ -168,6 +168,10 @@ Description .. cpp:type:: array_layout + The layout of the ``DynRankView``. (Deprecated since Kokkos 5.0) + + .. cpp:type:: layout_type + The layout of the ``DynRankView``. .. cpp:type:: size_type @@ -202,14 +206,14 @@ Description .. cpp:function:: DynRankView(const std::string& name, const IntType& ... indices) - Requires: ``array_layout::is_regular == true`` + Requires: ``layout_type::is_regular == true`` Standard allocating constructor. * ``name``: a user provided label, which is used for profiling and debugging purposes. Names are not required to be unique. * ``indices``: runtime dimensions of the view. - .. cpp:function:: DynRankView(const std::string& name, const array_layout& layout) + .. cpp:function:: DynRankView(const std::string& name, const layout_type& layout) Standard allocating constructor. @@ -218,13 +222,13 @@ Description .. cpp:function:: DynRankView(const AllocProperties& prop, const IntType& ... indices) - Requires: ``array_layout::is_regular == true`` + Requires: ``layout_type::is_regular == true`` Allocating constructor with allocation properties. An allocation properties object is returned by the ``view_alloc`` function. * ``indices``: runtime dimensions of the view. - .. cpp:function:: DynRankView(const AllocProperties& prop, const array_layout& layout) + .. cpp:function:: DynRankView(const AllocProperties& prop, const layout_type& layout) Allocating constructor with allocation properties and a layout object. @@ -232,14 +236,14 @@ Description .. cpp:function:: DynRankView(const pointer_type& ptr, const IntType& ... indices) - Requires: ``array_layout::is_regular == true`` + Requires: ``layout_type::is_regular == true`` Unmanaged data wrapping constructor. * ``ptr``: pointer to a user provided memory allocation. Must provide storage of size ``DynRankView::required_allocation_size(n0,...,nR)``. * ``indices``: runtime dimensions of the view. - .. cpp:function:: DynRankView(const pointer_type& ptr, const array_layout& layout) + .. cpp:function:: DynRankView(const pointer_type& ptr, const layout_type& layout) Unmanaged data wrapper constructor. @@ -248,14 +252,14 @@ Description .. cpp:function:: DynRankView(const ScratchSpace& space, const IntType& ... indices) - Requires: ``sizeof(IntType...)==rank_dynamic()`` and ``array_layout::is_regular == true`` + Requires: ``sizeof(IntType...)==rank_dynamic()`` and ``layout_type::is_regular == true`` Constructor which acquires memory from a Scratch Memory handle. * ``space``: scratch memory handle. Typically returned from ``team_handles`` in ``TeamPolicy`` kernels. * ``indices``: runtime dimensions of the view. - .. cpp:function:: DynRankView(const ScratchSpace& space, const array_layout& layout) + .. cpp:function:: DynRankView(const ScratchSpace& space, const layout_type& layout) Constructor which acquires memory from a Scratch Memory handle. @@ -285,7 +289,7 @@ Description .. rubric:: Data Layout, Dimensions, Strides - .. cpp:function:: constexpr array_layout layout() const + .. cpp:function:: constexpr layout_type layout() const Returns the layout object. Can be used to to construct other views with the same dimensions. @@ -353,9 +357,9 @@ Description size_t N2 = 0, size_t N3 = 0, size_t N4 = 0, \ size_t N5 = 0, size_t N6 = 0); - Returns the number of bytes necessary for an unmanaged view of the provided dimensions. This function is only valid if ``array_layout::is_regular == true``. + Returns the number of bytes necessary for an unmanaged view of the provided dimensions. This function is only valid if ``layout_type::is_regular == true``. - .. cpp:function:: static constexpr size_t required_allocation_size(const array_layout& layout); + .. cpp:function:: static constexpr size_t required_allocation_size(const layout_type& layout); :return: the number of bytes necessary for an unmanaged view of the provided layout. @@ -397,12 +401,12 @@ The following conditions must be met at and are evaluated at compile time: * If ``std::is_const::value == true`` than ``std::is_const::value == true``. * ``MemorySpaceAccess::assignable == true`` -Furthermore there are rules which must be met if ``DstType::array_layout`` is not the same as ``SrcType::array_layout``. These rules only cover cases where both layouts are one of ``LayoutLeft`` , ``LayoutRight`` or ``LayoutStride`` +Furthermore there are rules which must be met if ``DstType::layout_type`` is not the same as ``SrcType::layout_type``. These rules only cover cases where both layouts are one of ``LayoutLeft`` , ``LayoutRight`` or ``LayoutStride`` -* If neither ``DstType::array_layout`` nor ``SrcType::array_layout`` is ``LayoutStride``: - - If ``DstType::rank > 1`` than ``DstType::array_layout`` must be the same as ``SrcType::array_layout``. +* If neither ``DstType::layout_type`` nor ``SrcType::layout_type`` is ``LayoutStride``: + - If ``DstType::rank > 1`` than ``DstType::layout_type`` must be the same as ``SrcType::layout_type``. -* If either ``DstType::array_layout`` or ``SrcType::array_layout`` is ``LayoutStride`` +* If either ``DstType::layout_type`` or ``SrcType::layout_type`` is ``LayoutStride`` - For each dimension ``k`` it must hold that ``dst_view.extent(k) == src_view.extent(k)`` Examples diff --git a/docs/source/API/core/KokkosConcepts.rst b/docs/source/API/core/KokkosConcepts.rst index 511dea7ff..58bdf3499 100644 --- a/docs/source/API/core/KokkosConcepts.rst +++ b/docs/source/API/core/KokkosConcepts.rst @@ -111,8 +111,8 @@ and ``OpenMPTarget``, the current state of the Kokkos |ExecutionSpaceTwo|_ conce is_memory_space::value; typename Ex::size_type; std::is_integral_v; - typename Ex::array_layout; - is_array_layout::value; + typename Ex::layout_type; + is_layout_type::value; typename Ex::scratch_memory_space; is_memory_space::value; typename Ex::device_type; diff --git a/docs/source/API/core/Traits.rst b/docs/source/API/core/Traits.rst index 756eff95b..ffec64ddc 100644 --- a/docs/source/API/core/Traits.rst +++ b/docs/source/API/core/Traits.rst @@ -4,6 +4,12 @@ Traits is_array_layout --------------- +Boolean type trait to detect types that model the Layout concept. (Deprecated since Kokkos 5.0) + + +is_layout_type +-------------- + Boolean type trait to detect types that model the Layout concept. is_execution_policy diff --git a/docs/source/API/core/execution_spaces.rst b/docs/source/API/core/execution_spaces.rst index 41834c00e..920d982a1 100644 --- a/docs/source/API/core/execution_spaces.rst +++ b/docs/source/API/core/execution_spaces.rst @@ -236,7 +236,9 @@ Additionally, the following type aliases (a.k.a. ``typedef`` s) will be defined * ``Ex::memory_space``: the default |MemorySpace|_ to use when executing with ``Ex``. Kokkos guarantees that ``Kokkos::SpaceAccessibility::accessible`` will be ``true`` (see |KokkosSpaceAccessibility|_) -* ``Ex::array_layout``: the default ``ArrayLayout`` recommended for use with ``View`` types accessed from ``Ex``. +* ``Ex::array_layout``: the default ``ArrayLayout`` recommended for use with ``View`` types accessed from ``Ex``. //Deprecated since Kokkos 5.0 + +* ``Ex::layout_type``: the default ``LayoutType`` recommended for use with ``View`` types accessed from ``Ex``. * ``Ex::scratch_memory_space``: the ``ScratchMemorySpace`` that parallel patterns will use for allocation of scratch memory (for instance, as requested by a |KokkosTeamPolicy|_). Only unmanaged Views can be created using this memory space. @@ -268,7 +270,8 @@ Synopsis typedef ... memory_space; typedef Device device_type; typedef ... scratch_memory_space; - typedef ... array_layout; + typedef ... layout_type; + typedef ... array_layout; // Deprecated since Kokkos 5.0 typedef ... size_type; ExecutionSpaceConcept(); @@ -305,7 +308,7 @@ Typedefs * ``device_type``: ``DeviceType``. -* ``array_layout``: The default ``ArrayLayout`` recommended for use with ``View`` types accessed from |ExecutionSpaceConcept|_. +* ``layout_type``: The default ``LayoutType`` recommended for use with ``View`` types accessed from |ExecutionSpaceConcept|_. * ``scratch_memory_space``: The ``ScratchMemorySpace`` that parallel patterns will use for allocation of scratch memory (for instance, as requested by a |KokkosTeamPolicy|_). Only unmanaged Views can be created using this memory space. diff --git a/docs/source/API/core/view/deep_copy.rst b/docs/source/API/core/view/deep_copy.rst index a12fcff73..084050c18 100644 --- a/docs/source/API/core/view/deep_copy.rst +++ b/docs/source/API/core/view/deep_copy.rst @@ -52,7 +52,7 @@ Requirements - For all ``k`` in ``[0, dest.rank)`` ``dest.extent(k) == src.extent(k)`` (or the same as ``dest.rank()``) - - ``src.span_is_contiguous() && dest.span_is_contiguous() && std::is_same::value``, *or* there exists an `ExecutionSpace <../execution_spaces.html>`_ ``copy_space`` (either given or defaulted) such that both ``SpaceAccessibility::accessible == true`` and ``SpaceAccessibility::accessible == true``. + - ``src.span_is_contiguous() && dest.span_is_contiguous() && std::is_same::value``, *or* there exists an `ExecutionSpace <../execution_spaces.html>`_ ``copy_space`` (either given or defaulted) such that both ``SpaceAccessibility::accessible == true`` and ``SpaceAccessibility::accessible == true``. * If ``src`` is a `Kokkos::View `_ and ``dest`` is a scalar, then ``src.rank == 0`` is true. @@ -138,7 +138,7 @@ How to get layout incompatible views copied auto h_view_tmp = Kokkos::create_mirror_view(d_view); // This inherits the Layout from d_view - static_assert(std::is_same::value); // This now works since h_view_tmp and h_view are both accessible diff --git a/docs/source/API/core/view/layoutLeft.rst b/docs/source/API/core/view/layoutLeft.rst index b34b6f212..8d5561211 100644 --- a/docs/source/API/core/view/layoutLeft.rst +++ b/docs/source/API/core/view/layoutLeft.rst @@ -25,6 +25,10 @@ Description .. cpp:type:: array_layout + A tag signifying that this models the Layout concept. (Deprecated since Kokkos 5.0) + + .. cpp:type:: layout_type + A tag signifying that this models the Layout concept. .. rubric:: Member Variables diff --git a/docs/source/API/core/view/layoutRight.rst b/docs/source/API/core/view/layoutRight.rst index ba1869224..8b9d53744 100644 --- a/docs/source/API/core/view/layoutRight.rst +++ b/docs/source/API/core/view/layoutRight.rst @@ -25,6 +25,10 @@ Description .. cpp:type:: array_layout + A tag signifying that this models the Layout concept. (Deprecated since Kokkos 5.0) + + .. cpp:type:: layout_type + A tag signifying that this models the Layout concept. .. rubric:: Member Variables diff --git a/docs/source/API/core/view/layoutStride.rst b/docs/source/API/core/view/layoutStride.rst index e4876b5ae..2061f0a1b 100644 --- a/docs/source/API/core/view/layoutStride.rst +++ b/docs/source/API/core/view/layoutStride.rst @@ -41,7 +41,11 @@ Description .. cpp:type:: array_layout - A tag signifying that this models the Layout concept + A tag signifying that this models the Layout concept. (Deprecated since Kokkos 5.0) + + .. cpp:type:: layout_type + + A tag signifying that this models the Layout concept. .. rubric:: Constructors diff --git a/docs/source/API/core/view/realloc.rst b/docs/source/API/core/view/realloc.rst index e70e5ed8e..53132f022 100644 --- a/docs/source/API/core/view/realloc.rst +++ b/docs/source/API/core/view/realloc.rst @@ -38,7 +38,7 @@ Description - ``n[X]``: new length for extent X. -* Restrictions: ``View::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``. +* Restrictions: ``View::layout_type`` is either ``LayoutLeft`` or ``LayoutRight``. .. code-block:: cpp @@ -63,7 +63,7 @@ Description - ``arg_prop``: View constructor property, e.g., ``Kokkos::WithoutInitializing``. -* Restrictions: ``View::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``. +* Restrictions: ``View::layout_type`` is either ``LayoutLeft`` or ``LayoutRight``. .. code-block:: cpp @@ -91,7 +91,7 @@ Description * Restrictions: - - ``View::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``. + - ``View::layout_type`` is either ``LayoutLeft`` or ``LayoutRight``. - ``arg_prop`` must not include a pointer to memory, a label, or a memory space. @@ -99,7 +99,7 @@ Description template void realloc(Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& layout); * Resizes ``v`` to have the new dimensions without preserving its contents. @@ -111,7 +111,7 @@ Description template void realloc(const I& arg_prop, Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& layout); * Resizes ``v`` to have the new dimensions without preserving its contents. The new ``Kokkos::View`` is constructed using the View constructor property ``arg_prop``, e.g., Kokkos::WithoutInitializing. @@ -127,7 +127,7 @@ Description template void realloc(const ALLOC_PROP& arg_prop, Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& layout); * Resizes ``v`` to have the new dimensions without preserving its contents. The new ``Kokkos::View`` is constructed using the View constructor properties ``arg_prop``, e.g., ``Kokkos::view_alloc(Kokkos::WithoutInitializing)``. diff --git a/docs/source/API/core/view/resize.rst b/docs/source/API/core/view/resize.rst index 38e197ff0..74db190d8 100644 --- a/docs/source/API/core/view/resize.rst +++ b/docs/source/API/core/view/resize.rst @@ -40,7 +40,7 @@ Description Restrictions: - * ``View::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``. + * ``View::layout_type`` is either ``LayoutLeft`` or ``LayoutRight``. * .. code-block:: cpp @@ -67,7 +67,7 @@ Description Restrictions: - * ``View::array_layout`` is either ``LayoutLeft` or `LayoutRight``. + * ``View::layout_type`` is either ``LayoutLeft` or `LayoutRight``. * .. code-block:: cpp @@ -94,14 +94,14 @@ Description Restrictions: - * ``View::array_layout`` is either ``LayoutLeft`` or ``LayoutRight``. + * ``View::layout_type`` is either ``LayoutLeft`` or ``LayoutRight``. * ``arg_prop`` must not include a pointer to memory, a label, or a memory space. * .. code-block:: cpp template void resize(Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& layout); Resizes ``v`` to have the new dimensions while preserving the contents for the common subview of the old and new view. @@ -112,7 +112,7 @@ Description template void resize(const I& arg_prop, Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& 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 @@ -127,7 +127,7 @@ Description template void resize(const ALLOC_PROP& arg_prop, Kokkos::View& v, - const typename Kokkos::View::array_layout& layout); + const typename Kokkos::View::layout_type& 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 diff --git a/docs/source/API/core/view/view.rst b/docs/source/API/core/view/view.rst index a7b5cb240..f6afbca29 100644 --- a/docs/source/API/core/view/view.rst +++ b/docs/source/API/core/view/view.rst @@ -160,7 +160,7 @@ View Types .. cpp:type:: HostMirror - compatible view type with the same :cpp:type:`data_type` and :cpp:type:`array_layout` stored in host accessible memory space. + compatible view type with the same :cpp:type:`data_type` and :cpp:type:`layout_type` stored in host accessible memory space. Data Handles @@ -184,7 +184,13 @@ Data Handles Other Types ^^^^^^^^^^^ -.. cpp:type:: array_layout + .. deprecated:: 5.0 + +.. cpp:type:: array_type + + The :cpp:any:`LayoutType` of the :cpp:class:`View`. + +.. cpp:type:: layout_type The :cpp:any:`LayoutType` of the :cpp:class:`View`. @@ -233,9 +239,9 @@ Constructors - :cpp:expr:`sizeof(IntType...) == rank_dynamic()` or :cpp:expr:`sizeof(IntType...) == rank()`. In the latter case, the extents corresponding to compile-time dimensions must match the :cpp:class:`View` type's compile-time extents. - - :cpp:expr:`array_layout::is_regular == true`. + - :cpp:expr:`layout_type::is_regular == true`. -.. cpp:function:: View( const std::string& name, const array_layout& layout) +.. cpp:function:: View( const std::string& name, const layout_type& layout) Standard allocating constructor. The initialization is executed on the default instance of the execution space corresponding to :cpp:type:`memory_space` and fences it. @@ -263,9 +269,9 @@ Constructors - :cpp:expr:`sizeof(IntType...) == rank_dynamic()` or :cpp:expr:`sizeof(IntType...) == rank()`. In the latter case, the extents corresponding to compile-time dimensions must match the :cpp:class:`View` type's compile-time extents. - - :cpp:expr:`array_layout::is_regular == true`. + - :cpp:expr:`layout_type::is_regular == true`. -.. cpp:function:: View( const ALLOC_PROP &prop, const array_layout& layout) +.. cpp:function:: View( const ALLOC_PROP &prop, const layout_type& layout) Allocating constructor with allocation properties (created by a call to :cpp:func:`view_alloc`) and a layout object. If an execution space is specified in :cpp:any:`prop`, the initialization uses it and does not fence. @@ -292,9 +298,9 @@ Constructors - :cpp:expr:`sizeof(IntType...) == rank_dynamic()` or :cpp:expr:`sizeof(IntType...) == rank()`. In the latter case, the extents corresponding to compile-time dimensions must match the :cpp:class:`View` type's compile-time extents. - - :cpp:expr:`array_layout::is_regular == true`. + - :cpp:expr:`layout_type::is_regular == true`. -.. cpp:function:: View( pointer_type ptr, const array_layout& layout) +.. cpp:function:: View( pointer_type ptr, const layout_type& layout) Unmanaged data wrapper constructor. @@ -319,9 +325,9 @@ Constructors - :cpp:expr:`sizeof(IntType...) == rank_dynamic()` or :cpp:expr:`sizeof(IntType...) == rank()`. In the latter case, the extents corresponding to compile-time dimensions must match the :cpp:class:`View` type's compile-time extents. - - :cpp:expr:`array_layout::is_regular == true`. + - :cpp:expr:`layout_type::is_regular == true`. -.. cpp:function:: View( const ScratchSpace& space, const array_layout& layout) +.. cpp:function:: View( const ScratchSpace& space, const layout_type& layout) Constructor which acquires memory from a Scratch Memory handle. @@ -349,10 +355,10 @@ Constructors :cpp:`explicit(bool)` is only available on C++20 and later. When building Kokkos with C++17, this constructor will be fully implicit. Be aware that later upgrading to C++20 will in some cases cause compilation issues in cases where :cpp:`traits::is_managed` is :cpp:`false`. - :cpp:`NATURAL_MDSPAN_TYPE` is the :ref:`natural mdspan ` of the View. The *natural mdspan* is only available if :cpp:type:`array_layout` is one of :cpp:struct:`LayoutLeft`, :cpp:struct:`LayoutRight`, + :cpp:`NATURAL_MDSPAN_TYPE` is the :ref:`natural mdspan ` of the View. The *natural mdspan* is only available if :cpp:type:`layout_type` is one of :cpp:struct:`LayoutLeft`, :cpp:struct:`LayoutRight`, or :cpp:class:`LayoutStride`. This constructor is only available if *natural mdspan* is available. - Constructs a :cpp:class:`View` by converting from :cpp:any:`mds`. The :cpp:class:`View` will be unmanaged and constructed as if by :cpp:`View(mds.data(), array_layout_from_mapping(mds.mapping()))` + Constructs a :cpp:class:`View` by converting from :cpp:any:`mds`. The :cpp:class:`View` will be unmanaged and constructed as if by :cpp:`View(mds.data(), layout_type_from_mapping(mds.mapping()))` .. seealso:: :ref:`Natural mdspans ` @@ -441,7 +447,7 @@ Data Layout, Dimensions, Strides It may also break code that was using the type of :cpp:func:`rank`. Furthermore, it appears that MSVC has issues with the implicit conversion to :cpp:`size_t` in certain constexpr contexts. Calling :cpp:func:`rank()` or :cpp:func:`rank_dynamic()` will work in those cases. -.. cpp:function:: constexpr array_layout layout() const +.. cpp:function:: constexpr layout_type layout() const :return: the layout object that can be used to to construct other views with the same dimensions. @@ -560,9 +566,9 @@ Data Layout, Dimensions, Strides .. rubric:: Requirements: - - :cpp:expr:`array_layout::is_regular == true`. + - :cpp:expr:`layout_type::is_regular == true`. -.. cpp:function:: static constexpr size_t required_allocation_size(const array_layout& layout); +.. cpp:function:: static constexpr size_t required_allocation_size(const layout_type& layout); :param layout: the layout to query :return: the number of bytes necessary for an unmanaged :cpp:class:`View` of the provided layout. @@ -628,7 +634,7 @@ Non-Member Functions .. cpp:function:: template bool operator==(const View& lhs, const View& rhs) - :return: :cpp:`true` if :cpp:type:`~View::value_type`, :cpp:type:`~View::array_layout`, :cpp:type:`~View::memory_space`, :cpp:func:`~View::rank()`, :cpp:func:`~View::data()` and :cpp:expr:`extent(r)`, for :math:`0 \le r \lt \texttt{rank()}`, match. + :return: :cpp:`true` if :cpp:type:`~View::value_type`, :cpp:type:`~View::layout_type`, :cpp:type:`~View::memory_space`, :cpp:func:`~View::rank()`, :cpp:func:`~View::data()` and :cpp:expr:`extent(r)`, for :math:`0 \le r \lt \texttt{rank()}`, match. .. cpp:function:: template bool operator!=(const View& lhs, const View& rhs) @@ -662,14 +668,14 @@ Additionally the following conditions must be met at runtime: * If :cpp:`DstType::rank_dynamic() != DstType::rank()` then for each compile time dimension :cpp:`k` it must be true that :cpp:`dst_view.extent(k) == src_view.extent(k)`. -Furthermore there are rules which must be met if :cpp:`DstType::array_layout` is not the same as :cpp:`SrcType::array_layout`. +Furthermore there are rules which must be met if :cpp:`DstType::layout_type` is not the same as :cpp:`SrcType::layout_type`. These rules only cover cases where both layouts are one of :cpp:class:`LayoutLeft`, :cpp:class:`LayoutRight` or :cpp:class:`LayoutStride` -* If neither :cpp:`DstType::array_layout` nor :cpp:`SrcType::array_layout` is :cpp:class:`LayoutStride`: +* If neither :cpp:`DstType::layout_type` nor :cpp:`SrcType::layout_type` is :cpp:class:`LayoutStride`: - - If :cpp:`DstType::rank > 1` then :cpp:`DstType::array_layout` must be the same as :cpp:`SrcType::array_layout`. + - If :cpp:`DstType::rank > 1` then :cpp:`DstType::layout_type` must be the same as :cpp:`SrcType::layout_type`. -* If either :cpp:`DstType::array_layout` or :cpp:`SrcType::array_layout` is :cpp:class:`LayoutStride` +* If either :cpp:`DstType::layout_type` or :cpp:`SrcType::layout_type` is :cpp:class:`LayoutStride` - For each dimension :cpp:`k` it must hold that :cpp:`dst_view.extent(k) == src_view.extent(k)` @@ -711,9 +717,9 @@ For an mdspan :cpp:`m` of type :cpp:`M` that is the *natural mdspan* of a :cpp:c #. :cpp:`M::layout_type` is - * :cpp:`std::layout_left_padded` if :cpp:`V::array_layout` is :cpp:`LayoutLeft` - * :cpp:`std::layout_right_padded` if :cpp:`V::array_layout` is :cpp:`LayoutRight` - * :cpp:`std::layout_stride` if :cpp:`V::array_layout` is :cpp:any:`LayoutStride` + * :cpp:`std::layout_left_padded` if :cpp:`V::layout_type` is :cpp:`LayoutLeft` + * :cpp:`std::layout_right_padded` if :cpp:`V::layout_type` is :cpp:`LayoutRight` + * :cpp:`std::layout_stride` if :cpp:`V::layout_type` is :cpp:any:`LayoutStride` #. :cpp:`M::accessor_type` is :cpp:`std::default_accessor` diff --git a/docs/source/ProgrammingGuide/View.rst b/docs/source/ProgrammingGuide/View.rst index f4d04f24b..a7c0f51c6 100644 --- a/docs/source/ProgrammingGuide/View.rst +++ b/docs/source/ProgrammingGuide/View.rst @@ -409,14 +409,14 @@ We prefer that users let Kokkos determine a View's layout, based on its executio A.stride (strides); const int LDA = strides[1]; -You may ask a View for its layout via its `array_layout` typedef. This can be helpful for C++ template metaprogramming. For example: +You may ask a View for its layout via its `layout_type` typedef. This can be helpful for C++ template metaprogramming. For example: .. code-block:: c++ template void callBlas (const ViewType& A) { - typedef typename ViewType::array_layout array_layout; - if (std::is_same::value) { + typedef typename ViewType::layout_type layout_type; + if (std::is_same::value) { callSomeBlasFunction (A.data(), ...); } else { throw std::invalid_argument ("A is not LayoutLeft"); diff --git a/docs/source/templates/class_api.rst b/docs/source/templates/class_api.rst index 220c78398..560229886 100644 --- a/docs/source/templates/class_api.rst +++ b/docs/source/templates/class_api.rst @@ -141,7 +141,7 @@ Non-Member Functions :tparam ViewDst: the other - :return: true if :cpp:type:`View::value_type`, :cpp:type:`View::array_layout`, :cpp:type:`View::memory_space`, :cpp:func:`View::rank`, :cpp:func:`View::data()` and :cpp:expr:`View::extent(r)`, for :cpp:expr:`0<=r