You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may also break code that was using the type of :cpp:func:`rank`.
402
411
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.
:return: the pointer to the underlying data allocation.
512
+
:return: the pointer to the underlying data allocation.
504
513
505
-
.. warning::
506
-
507
-
Calling any function that manipulates the behavior of the memory (e.g. ``memAdvise``) on memory managed by Kokkos results in undefined behavior.
514
+
.. warning::
515
+
516
+
Calling any function that manipulates the behavior of the memory (e.g. ``memAdvise``) on memory managed by Kokkos results in undefined behavior.
508
517
509
-
.. cpp:function::boolspan_is_contiguous() const
518
+
.. cpp:function::boolspan_is_contiguous() const
510
519
511
-
:return: whether the span is contiguous (i.e. whether every memory location between in span belongs to the index space covered by the :cpp:class:`View`).
520
+
:return: whether the span is contiguous (i.e. whether every memory location between in span belongs to the index space covered by the :cpp:class:`View`).
:param arg_data: the pointer to set the underlying :cpp:class:`View` data pointer to
553
558
554
-
Returns true if the view points to a valid memory location.
555
-
This function works for both managed and unmanaged views.
556
-
With the unmanaged view, there is no guarantee that referenced
557
-
address is valid, only that it is a non-null pointer.
559
+
Decrement reference count of previously assigned data and set the underlying pointer to arg_data.
560
+
Note that the effective result of this operation is that the view is now an unmanaged view; thus, the deallocation of memory associated with arg_data is not linked in anyway to the deallocation of the view.
.. cpp:function::template <classOtherElementType, class OtherExtents, class OtherLayoutPolicy, class OtherAccessor> constexproperator mdspan<OtherElementType, OtherExtents, OtherLayoutPolicy, OtherAccessor>()
564
+
:return: true if the view points to a valid memory location.
563
565
564
-
:tparam OtherElementType: the target mdspan element type
565
-
:tparam OtherExtents: the target mdspan extents
566
-
:tparam OtherLayoutPolicy: the target mdspan layout
567
-
:tparam OtherAccessor: the target mdspan accessor
566
+
This function works for both managed and unmanaged views.
567
+
With the unmanaged view, there is no guarantee that referenced address is valid, only that it is a non-null pointer.
568
568
569
-
:constraints::cpp:class:`View`\ 's :ref:`natural mdspan <api-view-natural-mdspans>` must be assignable to :cpp:`mdspan<OtherElementType, OtherExtents, OtherLayoutPolicy, OtherAccessor>`
569
+
.. rubric:: Conversion to mdspan
570
570
571
-
:returns: an mdspan with extents and a layout converted from the :cpp:class:`View`'s *natural mdspan*.
571
+
.. cpp:function::template <classOtherElementType, class OtherExtents, class OtherLayoutPolicy, class OtherAccessor> constexproperatormdspan<OtherElementType, OtherExtents, OtherLayoutPolicy, OtherAccessor>()
:tparam OtherElementType: the target mdspan element type
574
+
:tparam OtherExtents: the target mdspan extents
575
+
:tparam OtherLayoutPolicy: the target mdspan layout
576
+
:tparam OtherAccessor: the target mdspan accessor
574
577
575
-
:tparam OtherAccessor: the target mdspan accessor
578
+
:constraints::cpp:class:`View`\ 's :ref:`natural mdspan <api-view-natural-mdspans>` must be assignable to :cpp:`mdspan<OtherElementType, OtherExtents, OtherLayoutPolicy, OtherAccessor>`
576
579
577
-
:constraints::cpp:`typename OtherAccessorType::data_handle_type` must be assignable to :cpp:`value_type*`
580
+
:returns: an mdspan with extents and a layout converted from the :cpp:class:`View`'s *natural mdspan*.
578
581
579
-
:returns::cpp:class:`View`\ 's :ref:`natural mdspan <api-view-natural-mdspans>`, but with an accessor policy constructed from :cpp:any:`other_accessor`
:constraints::cpp:`typename OtherAccessorType::data_handle_type` must be assignable to :cpp:`value_type*`
587
+
588
+
:returns::cpp:class:`View`\ 's :ref:`natural mdspan <api-view-natural-mdspans>`, but with an accessor policy constructed from :cpp:any:`other_accessor`
589
+
590
+
591
+
Non-Member Functions
592
+
--------------------
584
593
585
594
.. cpp:function::template<classViewDst, class ViewSrc> booloperator==(ViewDst, ViewSrc);
586
595
587
-
Returns true if ``value_type``, ``array_layout``, ``memory_space``, ``rank``, ``data()`` and ``extent(r)``, for ``0<=r<rank``, match.
596
+
: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.
588
597
589
598
.. cpp:function::template<classViewDst, class ViewSrc> booloperator!=(ViewDst, ViewSrc);
590
599
591
600
Returns true if any of ``value_type``, ``array_layout``, ``memory_space``, ``rank``, ``data()`` and ``extent(r)``, for ``0<=r<rank`` don't match.
592
601
593
-
.. _api-view-datatype:
594
-
595
-
:cpp:class:`View` DataType
596
-
--------------------------
602
+
.. _api-view-assignment:
597
603
598
604
Assignment Rules
599
605
----------------
@@ -632,10 +638,8 @@ These rules only cover cases where both layouts are one of ``LayoutLeft``, ``Lay
632
638
633
639
- For each dimension ``k`` it must hold that ``dst_view.extent(k) == src_view.extent(k)``
0 commit comments