13#include <Kokkos_Core.hpp>
15#include "ddc/chunk_common.hpp"
16#include "ddc/detail/kokkos.hpp"
17#include "ddc/detail/type_seq.hpp"
18#include "ddc/detail/type_traits.hpp"
19#include "ddc/discrete_domain.hpp"
20#include "ddc/discrete_element.hpp"
24template <
class,
class,
class>
30 class LayoutStridedPolicy = Kokkos::layout_right,
31 class MemorySpace = Kokkos::DefaultHostExecutionSpace::memory_space>
44template <
class ElementType,
class... DDims,
class LayoutStridedPolicy,
class MemorySpace>
49 std::is_same_v<LayoutStridedPolicy, Kokkos::layout_left>
50 || std::is_same_v<LayoutStridedPolicy, Kokkos::layout_right>
51 || std::is_same_v<LayoutStridedPolicy, Kokkos::layout_stride>,
52 "ChunkSpan only supports layout_left, layout_right or layout_stride");
58 using typename base_type::internal_mdspan_type;
72 using discrete_domain_type =
typename base_type::discrete_domain_type;
74 using memory_space = MemorySpace;
77 using allocation_mdspan_type =
typename base_type::allocation_mdspan_type;
79 using const_allocation_mdspan_type =
typename base_type::const_allocation_mdspan_type;
81 using discrete_element_type =
typename discrete_domain_type::discrete_element_type;
83 using discrete_vector_type =
typename discrete_domain_type::discrete_vector_type;
85 using extents_type =
typename base_type::extents_type;
87 using layout_type =
typename base_type::layout_type;
89 using accessor_type =
typename base_type::accessor_type;
91 using mapping_type =
typename base_type::mapping_type;
93 using element_type =
typename base_type::element_type;
95 using value_type =
typename base_type::value_type;
97 using size_type =
typename base_type::size_type;
99 using data_handle_type =
typename base_type::data_handle_type;
101 using reference =
typename base_type::reference;
103 template <
class,
class,
class,
class>
108 allocation_mdspan_type
const& allocation_mdspan,
109 discrete_domain_type
const& domain)
111 if (!domain.empty()) {
112 extents_type
const extents_s(
113 (front<DDims>(domain) +
ddc::extents<DDims>(domain)).uid()...);
114 std::array<std::size_t,
sizeof...(DDims)>
const strides_s {
115 allocation_mdspan.mapping().stride(
116 type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>)...};
117 Kokkos::layout_stride::mapping<extents_type>
const mapping_s(extents_s, strides_s);
118 return internal_mdspan_type(
119 allocation_mdspan.data_handle() - mapping_s(front<DDims>(domain).uid()...),
123 return internal_mdspan_type(allocation_mdspan);
126 template <
class QueryDDim,
class... ODDims>
129 DDC_IF_NVCC_THEN_PUSH_AND_SUPPRESS(implicit_return_from_non_void_function)
130 if constexpr (in_tags_v<QueryDDim, detail::TypeSeq<ODDims...>>) {
131 return (uid<QueryDDim>(c) - front<QueryDDim>(
this->m_domain).uid());
133 return Kokkos::full_extent;
138 template <
class QueryDDim,
class... ODDims>
141 DDC_IF_NVCC_THEN_PUSH_AND_SUPPRESS(implicit_return_from_non_void_function)
142 if constexpr (in_tags_v<QueryDDim, detail::TypeSeq<ODDims...>>) {
143 return std::pair<std::size_t, std::size_t>(
144 front<QueryDDim>(c) - front<QueryDDim>(
this->m_domain),
145 back<QueryDDim>(c) + 1 - front<QueryDDim>(
this->m_domain));
147 return Kokkos::full_extent;
157
158
162
163
167
171 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
172 ChunkSpan(
Chunk<OElementType, discrete_domain_type, Allocator>&& other)
noexcept =
delete;
175
176
180 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
182 Chunk<OElementType, discrete_domain_type, Allocator>& other)
noexcept
183 : base_type(other.m_internal_mdspan, other.m_domain)
188
189
193 class SFINAEElementType = ElementType,
194 class = std::enable_if_t<std::is_const_v<SFINAEElementType>>,
196 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
198 Chunk<OElementType, discrete_domain_type, Allocator>
const& other)
noexcept
199 : base_type(other.m_internal_mdspan, other.m_domain)
204
205
206 template <
class OElementType>
208 ChunkSpan<OElementType, discrete_domain_type, layout_type, MemorySpace>
const&
210 : base_type(other.m_internal_mdspan, other.m_domain)
215
216
217
219 class Mapping = mapping_type,
220 std::enable_if_t<std::is_constructible_v<Mapping, extents_type>,
int> = 0>
222 : base_type(ptr, domain)
227
228
229
231 allocation_mdspan_type allocation_mdspan,
232 discrete_domain_type
const& domain)
235 assert(((allocation_mdspan.extent(type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>)
236 ==
static_cast<std::size_t>(domain.
template extent<DDims>().value()))
241
242
243
244 template <
class KokkosView,
class = std::enable_if_t<Kokkos::is_view_v<KokkosView>>>
246 KokkosView
const& view,
247 discrete_domain_type
const& domain)
noexcept
249 detail::build_mdspan(view, std::make_index_sequence<
sizeof...(DDims)> {}),
257
258
259
263
264
265
269
270 template <
class... QueryDDims>
272 DiscreteElement<QueryDDims...>
const& slice_spec)
const
274 auto subview = Kokkos::submdspan(
allocation_mdspan(), get_slicer_for<DDims>(slice_spec)...);
275 using layout_type =
typename decltype(subview)::layout_type;
276 using extents_type =
typename decltype(subview)::extents_type;
277 using detail::TypeSeq;
278 using OutTypeSeqDDims = type_seq_remove_t<TypeSeq<DDims...>, TypeSeq<QueryDDims...>>;
279 using OutDDom = detail::convert_type_seq_to_discrete_domain_t<OutTypeSeqDDims>;
281 std::is_same_v<layout_type, Kokkos::Experimental::layout_left_padded<>>
282 || std::is_same_v<layout_type, Kokkos::Experimental::layout_right_padded<>>) {
283 Kokkos::layout_stride::mapping<extents_type>
const mapping_stride(subview.mapping());
284 Kokkos::mdspan<ElementType, extents_type, Kokkos::layout_stride>
const
285 a(subview.data_handle(), mapping_stride);
289 Kokkos::layout_stride,
290 memory_space>(a, OutDDom(
this->m_domain));
296 memory_space>(subview, OutDDom(
this->m_domain));
301
302 template <
class... QueryDDims>
306 using layout_type =
typename decltype(subview)::layout_type;
307 using extents_type =
typename decltype(subview)::extents_type;
309 std::is_same_v<layout_type, Kokkos::Experimental::layout_left_padded<>>
310 || std::is_same_v<layout_type, Kokkos::Experimental::layout_right_padded<>>) {
311 Kokkos::layout_stride::mapping<extents_type>
const mapping_stride(subview.mapping());
312 Kokkos::mdspan<ElementType, extents_type, Kokkos::layout_stride>
const
313 a(subview.data_handle(), mapping_stride);
316 decltype(
this->m_domain.restrict_with(odomain)),
317 Kokkos::layout_stride,
318 memory_space>(a,
this->m_domain.restrict_with(odomain));
322 decltype(
this->m_domain.restrict_with(odomain)),
324 memory_space>(subview,
this->m_domain.restrict_with(odomain));
329
330
331
334 std::enable_if_t<detail::all_of_v<is_discrete_element_v<DElems>...>,
int> = 0>
338 sizeof...(DDims) == (0 + ... + DElems::size()),
339 "Invalid number of dimensions");
340 assert(
this->m_domain.contains(delems...));
341 return DDC_MDSPAN_ACCESS_OP(
this->m_internal_mdspan, uid<DDims>(take<DDims>(delems...))...);
345
346
347
350 std::enable_if_t<detail::all_of_v<is_discrete_vector_v<DVects>...>,
int> = 0,
351 std::enable_if_t<
sizeof...(DVects) != 0,
int> = 0>
355 sizeof...(DDims) == (0 + ... + DVects::size()),
356 "Invalid number of dimensions");
357 discrete_element_type
const delem
358 =
this->m_domain.front() + discrete_vector_type(dvects...);
359 return DDC_MDSPAN_ACCESS_OP(
this->m_internal_mdspan, uid<DDims>(delem)...);
363
364
367 return base_type::data_handle();
371
372
375 return base_type::allocation_mdspan();
379
380
383 auto s =
this->allocation_mdspan();
384 auto kokkos_layout = detail::build_kokkos_layout(
387 std::make_index_sequence<
sizeof...(DDims)> {});
389 detail::mdspan_to_kokkos_element_t<ElementType,
sizeof...(DDims)>,
390 decltype(kokkos_layout),
391 MemorySpace>(s.data_handle(), kokkos_layout);
396 return view_type(*
this);
405template <
class ElementType,
class SupportType,
class LayoutStridedPolicy,
class MemorySpace>
409 std::is_same_v<LayoutStridedPolicy, Kokkos::layout_left>
410 || std::is_same_v<LayoutStridedPolicy, Kokkos::layout_right>
411 || std::is_same_v<LayoutStridedPolicy, Kokkos::layout_stride>,
412 "ChunkSpan only supports layout_left, layout_right or layout_stride");
415 using base_type =
ChunkCommon<ElementType, SupportType, LayoutStridedPolicy>;
419 using span_type =
ChunkSpan<ElementType, SupportType, LayoutStridedPolicy, MemorySpace>;
422 using view_type =
ChunkSpan<ElementType
const, SupportType, LayoutStridedPolicy, MemorySpace>;
424 using discrete_domain_type =
typename base_type::discrete_domain_type;
426 using memory_space = MemorySpace;
429 using allocation_mdspan_type =
typename base_type::allocation_mdspan_type;
431 using const_allocation_mdspan_type =
typename base_type::const_allocation_mdspan_type;
433 using discrete_element_type =
typename discrete_domain_type::discrete_element_type;
435 using discrete_vector_type =
typename discrete_domain_type::discrete_vector_type;
437 using extents_type =
typename base_type::extents_type;
439 using layout_type =
typename base_type::layout_type;
441 using accessor_type =
typename base_type::accessor_type;
443 using mapping_type =
typename base_type::mapping_type;
445 using element_type =
typename base_type::element_type;
447 using value_type =
typename base_type::value_type;
449 using size_type =
typename base_type::size_type;
451 using data_handle_type =
typename base_type::data_handle_type;
453 using reference =
typename base_type::reference;
455 template <
class,
class,
class,
class>
459 template <
class QueryDDim,
class... ODDims>
462 DDC_IF_NVCC_THEN_PUSH_AND_SUPPRESS(implicit_return_from_non_void_function)
463 if constexpr (in_tags_v<QueryDDim, detail::TypeSeq<ODDims...>>) {
464 return c.
template get<QueryDDim>();
466 return Kokkos::full_extent;
471 template <
class TypeSeq>
474 template <
class... DDims>
475 struct slicer<detail::TypeSeq<DDims...>>
477 template <
class... ODDims>
478 KOKKOS_FUNCTION
constexpr auto operator()(
479 allocation_mdspan_type
const& span,
482 return Kokkos::submdspan(span, get_slicer_for<DDims>(c)...);
491
492
496
497
501
505 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
506 ChunkSpan(
Chunk<OElementType, SupportType, Allocator>&& other)
noexcept =
delete;
509
510
514 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
516 Chunk<OElementType, SupportType, Allocator>& other)
noexcept
517 : base_type(other.m_allocation_mdspan, other.m_domain)
522
523
527 class SFINAEElementType = ElementType,
528 class = std::enable_if_t<std::is_const_v<SFINAEElementType>>,
530 class = std::enable_if_t<std::is_same_v<
typename Allocator::memory_space, MemorySpace>>>
532 Chunk<OElementType, SupportType, Allocator>
const& other)
noexcept
533 : base_type(other.m_allocation_mdspan, other.m_domain)
538
539
540 template <
class OElementType>
542 ChunkSpan<OElementType, SupportType, layout_type, MemorySpace>
const& other)
noexcept
543 : base_type(other.m_allocation_mdspan, other.m_domain)
548
549
550
552 class Mapping = mapping_type,
553 std::enable_if_t<std::is_constructible_v<Mapping, extents_type>,
int> = 0>
555 : base_type(ptr, domain)
560
561
562
564 allocation_mdspan_type allocation_mdspan,
565 SupportType
const& domain)
566 : base_type(allocation_mdspan, domain)
568 for (std::size_t i = 0; i < SupportType::rank(); ++i) {
569 assert(allocation_mdspan.extent(i)
570 ==
static_cast<std::size_t>(detail::array(domain.extents())[i]));
575
576
577
578 template <
class KokkosView,
class = std::enable_if_t<Kokkos::is_view_v<KokkosView>>>
581 detail::build_mdspan(view, std::make_index_sequence<SupportType::rank()> {}),
589
590
591
595
596
597
601
602 template <
class... QueryDDims>
604 DiscreteElement<QueryDDims...>
const& slice_spec)
const
606 slicer<to_type_seq_t<SupportType>>
const slicer;
608 = slicer(
this->allocation_mdspan(),
this->m_domain.distance_from_front(slice_spec));
609 using layout_type =
typename decltype(subview)::layout_type;
610 using extents_type =
typename decltype(subview)::extents_type;
611 using detail::TypeSeq;
612 using OutTypeSeqDDims
613 = type_seq_remove_t<to_type_seq_t<SupportType>, TypeSeq<QueryDDims...>>;
614 using OutDDom =
typename detail::RebindDomain<SupportType, OutTypeSeqDDims>::type;
616 std::is_same_v<layout_type, Kokkos::Experimental::layout_left_padded<>>
617 || std::is_same_v<layout_type, Kokkos::Experimental::layout_right_padded<>>) {
618 Kokkos::layout_stride::mapping<extents_type>
const mapping_stride(subview.mapping());
619 Kokkos::mdspan<ElementType, extents_type, Kokkos::layout_stride>
const
620 a(subview.data_handle(), mapping_stride);
624 Kokkos::layout_stride,
625 memory_space>(a, OutDDom(
this->m_domain));
631 memory_space>(subview, OutDDom(
this->m_domain));
636
637
638
641 std::enable_if_t<detail::all_of_v<is_discrete_element_v<DElems>...>,
int> = 0>
645 SupportType::rank() == (0 + ... + DElems::size()),
646 "Invalid number of dimensions");
647 assert(
this->m_domain.contains(delems...));
648 return DDC_MDSPAN_ACCESS_OP(
649 this->m_allocation_mdspan,
650 detail::array(
this->m_domain.distance_from_front(delems...)));
654
655
656
659 std::enable_if_t<detail::all_of_v<is_discrete_vector_v<DVects>...>,
int> = 0,
660 std::enable_if_t<
sizeof...(DVects) != 0,
int> = 0>
664 SupportType::rank() == (0 + ... + DVects::size()),
665 "Invalid number of dimensions");
666 return DDC_MDSPAN_ACCESS_OP(
667 this->m_allocation_mdspan,
668 detail::array(discrete_vector_type(dvects...)));
672
673
676 return base_type::data_handle();
680
681
684 return base_type::allocation_mdspan();
688
689
692 auto s =
this->allocation_mdspan();
693 auto kokkos_layout = detail::build_kokkos_layout(
696 std::make_index_sequence<SupportType::rank()> {});
698 detail::mdspan_to_kokkos_element_t<ElementType, SupportType::rank()>,
699 decltype(kokkos_layout),
700 MemorySpace>(s.data_handle(), kokkos_layout);
705 return view_type(*
this);
714template <
class DataType,
class... Properties,
class SupportType>
716 Kokkos::View<DataType, Properties...>
const& view,
719 detail::kokkos_to_mdspan_element_t<
720 typename Kokkos::View<DataType, Properties...>::
data_type>,
722 detail::kokkos_to_mdspan_layout_t<
723 typename Kokkos::View<DataType, Properties...>::
array_layout>,
724 typename Kokkos::View<DataType, Properties...>::
memory_space>;
726template <
class ElementType,
class SupportType,
class Allocator>
730 Kokkos::layout_right,
733template <
class ElementType,
class SupportType,
class Allocator>
737 Kokkos::layout_right,
743 class LayoutStridedPolicy = Kokkos::layout_right,
744 class MemorySpace = Kokkos::HostSpace>
745using ChunkView =
ChunkSpan<ElementType
const, SupportType, LayoutStridedPolicy, MemorySpace>;
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan & operator=(ChunkSpan const &other)=default
Copy-assigns a new value to this ChunkSpan, yields a new view to the same data.
KOKKOS_FUNCTION constexpr auto allocation_kokkos_view() const
Provide a mdspan on the memory allocation.
KOKKOS_FUNCTION constexpr ElementType * data_handle() const
Access to the underlying allocation pointer.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan()=default
Empty ChunkSpan.
KOKKOS_FUNCTION constexpr ChunkSpan(Chunk< OElementType, discrete_domain_type, Allocator > &other) noexcept
Constructs a new ChunkSpan from a Chunk, yields a new view to the same data.
ChunkSpan(Chunk< OElementType, discrete_domain_type, Allocator > &&other) noexcept=delete
Forbids to construct a ChunkSpan from a rvalue of type Chunk.
KOKKOS_FUNCTION constexpr auto get_slicer_for(DiscreteElement< ODDims... > const &c) const
KOKKOS_FUNCTION constexpr span_type span_view() const
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
Provide a mdspan on the memory allocation.
KOKKOS_FUNCTION constexpr auto operator[](DiscreteDomain< QueryDDims... > const &odomain) const
Restrict to a subdomain.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan(ChunkSpan &&other) noexcept=default
Constructs a new ChunkSpan by move.
KOKKOS_FUNCTION constexpr ChunkSpan(KokkosView const &view, discrete_domain_type const &domain) noexcept
Constructs a new ChunkSpan from scratch.
static KOKKOS_FUNCTION internal_mdspan_type build_internal_mdspan(allocation_mdspan_type const &allocation_mdspan, discrete_domain_type const &domain)
KOKKOS_FUNCTION constexpr reference operator()(DElems const &... delems) const noexcept
Element access using a list of DiscreteElement.
KOKKOS_DEFAULTED_FUNCTION ~ChunkSpan() noexcept=default
KOKKOS_FUNCTION constexpr ChunkSpan(Chunk< OElementType, discrete_domain_type, Allocator > const &other) noexcept
Constructs a new ChunkSpan from a Chunk, yields a new view to the same data.
KOKKOS_FUNCTION constexpr auto operator[](DiscreteElement< QueryDDims... > const &slice_spec) const
Slice out some dimensions.
KOKKOS_FUNCTION constexpr ChunkSpan(ElementType *const ptr, discrete_domain_type const &domain)
Constructs a new ChunkSpan from scratch.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan & operator=(ChunkSpan &&other) noexcept=default
Move-assigns a new value to this ChunkSpan.
KOKKOS_FUNCTION constexpr ChunkSpan(ChunkSpan< OElementType, discrete_domain_type, layout_type, MemorySpace > const &other) noexcept
Constructs a new ChunkSpan by copy of a chunk, yields a new view to the same data.
KOKKOS_FUNCTION constexpr ChunkSpan(allocation_mdspan_type allocation_mdspan, discrete_domain_type const &domain)
Constructs a new ChunkSpan from scratch.
KOKKOS_FUNCTION constexpr auto get_slicer_for(DiscreteDomain< ODDims... > const &c) const
KOKKOS_FUNCTION constexpr view_type span_cview() const
KOKKOS_FUNCTION constexpr reference operator()(DVects const &... dvects) const noexcept
Element access using a list of DiscreteVector.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan(ChunkSpan const &other)=default
Constructs a new ChunkSpan by copy, yields a new view to the same data.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan(ChunkSpan &&other) noexcept=default
Constructs a new ChunkSpan by move.
KOKKOS_FUNCTION constexpr view_type span_cview() const
KOKKOS_FUNCTION constexpr ChunkSpan(Chunk< OElementType, SupportType, Allocator > const &other) noexcept
Constructs a new ChunkSpan from a Chunk, yields a new view to the same data.
KOKKOS_FUNCTION constexpr ChunkSpan(allocation_mdspan_type allocation_mdspan, SupportType const &domain)
Constructs a new ChunkSpan from scratch.
KOKKOS_FUNCTION constexpr auto operator[](DiscreteElement< QueryDDims... > const &slice_spec) const
Slice out some dimensions.
KOKKOS_FUNCTION constexpr ChunkSpan(KokkosView const &view, SupportType const &domain) noexcept
Constructs a new ChunkSpan from scratch.
ChunkSpan(Chunk< OElementType, SupportType, Allocator > &&other) noexcept=delete
Forbids to construct a ChunkSpan from a rvalue of type Chunk.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan(ChunkSpan const &other)=default
Constructs a new ChunkSpan by copy, yields a new view to the same data.
KOKKOS_FUNCTION constexpr ChunkSpan(ElementType *const ptr, SupportType const &domain)
Constructs a new ChunkSpan from scratch.
static KOKKOS_FUNCTION constexpr auto get_slicer_for(DiscreteVector< ODDims... > const &c)
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan()=default
Empty ChunkSpan.
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
Provide a mdspan on the memory allocation.
KOKKOS_FUNCTION constexpr ElementType * data_handle() const
Access to the underlying allocation pointer.
KOKKOS_FUNCTION constexpr auto allocation_kokkos_view() const
Provide a mdspan on the memory allocation.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan & operator=(ChunkSpan const &other)=default
Copy-assigns a new value to this ChunkSpan, yields a new view to the same data.
KOKKOS_FUNCTION constexpr ChunkSpan(Chunk< OElementType, SupportType, Allocator > &other) noexcept
Constructs a new ChunkSpan from a Chunk, yields a new view to the same data.
KOKKOS_FUNCTION constexpr ChunkSpan(ChunkSpan< OElementType, SupportType, layout_type, MemorySpace > const &other) noexcept
Constructs a new ChunkSpan by copy of a chunk, yields a new view to the same data.
KOKKOS_DEFAULTED_FUNCTION ~ChunkSpan() noexcept=default
KOKKOS_FUNCTION constexpr span_type span_view() const
KOKKOS_FUNCTION constexpr reference operator()(DElems const &... delems) const noexcept
Element access using a list of DiscreteElement.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkSpan & operator=(ChunkSpan &&other) noexcept=default
Move-assigns a new value to this ChunkSpan.
KOKKOS_FUNCTION constexpr reference operator()(DVects const &... dvects) const noexcept
Element access using a list of DiscreteVector.
friend class DiscreteDomain
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
The top-level namespace of DDC.
constexpr bool enable_borrowed_chunk< ChunkSpan< ElementType, SupportType, LayoutStridedPolicy, MemorySpace > >
ChunkSpan(Chunk< ElementType, SupportType, Allocator > const &other) -> ChunkSpan< ElementType const, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
ChunkSpan(Chunk< ElementType, SupportType, Allocator > &other) -> ChunkSpan< ElementType, SupportType, Kokkos::layout_right, typename Allocator::memory_space >
constexpr bool enable_chunk< ChunkSpan< ElementType, SupportType, LayoutStridedPolicy, MemorySpace > >
KOKKOS_DEDUCTION_GUIDE ChunkSpan(Kokkos::View< DataType, Properties... > const &view, SupportType domain) -> ChunkSpan< detail::kokkos_to_mdspan_element_t< typename Kokkos::View< DataType, Properties... >::data_type >, SupportType, detail::kokkos_to_mdspan_layout_t< typename Kokkos::View< DataType, Properties... >::array_layout >, typename Kokkos::View< DataType, Properties... >::memory_space >