DDC 0.6.0
Loading...
Searching...
No Matches
chunk_common.hpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <array>
8#include <cassert>
9#include <cstddef>
10#include <type_traits>
11#include <utility>
12
13#include <Kokkos_Core.hpp>
14
15#include "ddc/chunk_traits.hpp"
16#include "ddc/detail/macros.hpp"
17#include "ddc/discrete_domain.hpp"
18
19namespace ddc {
20
21/** Access the domain (or subdomain) of a view
22 * @param[in] chunk the view whose domain to access
23 * @return the domain of view in the queried dimensions
24 */
25template <class... QueryDDims, class ChunkType>
26KOKKOS_FUNCTION auto get_domain(ChunkType const& chunk) noexcept
27{
28 static_assert(is_chunk_v<ChunkType>, "Not a chunk span type");
29 return chunk.template domain<QueryDDims...>();
30}
31
32template <class ElementType, class SupportType, class LayoutStridedPolicy>
33class ChunkCommon;
34
35template <class ElementType, class... DDims, class LayoutStridedPolicy>
36class ChunkCommon<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy>
37{
38protected:
39 /// the raw mdspan underlying this, with the same indexing (0 might no be dereferenceable)
40 using internal_mdspan_type = Kokkos::mdspan<
41 ElementType,
42 Kokkos::dextents<std::size_t, sizeof...(DDims)>,
43 Kokkos::layout_stride>;
44
45public:
46 using discrete_domain_type = DiscreteDomain<DDims...>;
47
48 /// The dereferenceable part of the co-domain but with a different domain, starting at 0
49 using allocation_mdspan_type = Kokkos::mdspan<
50 ElementType,
51 Kokkos::dextents<std::size_t, sizeof...(DDims)>,
52 LayoutStridedPolicy>;
53
54 using const_allocation_mdspan_type = Kokkos::mdspan<
55 ElementType const,
56 Kokkos::dextents<std::size_t, sizeof...(DDims)>,
57 LayoutStridedPolicy>;
58
59 using discrete_element_type = typename discrete_domain_type::discrete_element_type;
60
61 using discrete_vector_type = typename discrete_domain_type::discrete_vector_type;
62
63 using extents_type = typename allocation_mdspan_type::extents_type;
64
65 using layout_type = typename allocation_mdspan_type::layout_type;
66
67 using accessor_type = typename allocation_mdspan_type::accessor_type;
68
69 using mapping_type = typename allocation_mdspan_type::mapping_type;
70
71 using element_type = typename allocation_mdspan_type::element_type;
72
73 using value_type = typename allocation_mdspan_type::value_type;
74
75 using size_type = typename allocation_mdspan_type::size_type;
76
77 using data_handle_type = typename allocation_mdspan_type::data_handle_type;
78
79 using reference = typename allocation_mdspan_type::reference;
80
81 // ChunkCommon, ChunkSpan and Chunk need to access to m_internal_mdspan and m_domain of other template versions
82 template <class, class, class>
83 friend class ChunkCommon;
84
85 template <class, class, class, class>
86 friend class ChunkSpan;
87
88 template <class, class, class>
89 friend class Chunk;
90
91 static_assert(mapping_type::is_always_strided());
92
93protected:
94 /// The raw view of the data
95 internal_mdspan_type m_internal_mdspan;
96
97 /// The mesh on which this chunk is defined
98 discrete_domain_type m_domain;
99
100public:
101 static KOKKOS_FUNCTION constexpr int rank() noexcept
102 {
103 return extents_type::rank();
104 }
105
106 static KOKKOS_FUNCTION constexpr int rank_dynamic() noexcept
107 {
108 return extents_type::rank_dynamic();
109 }
110
111 static KOKKOS_FUNCTION constexpr size_type static_extent(std::size_t r) noexcept
112 {
113 return extents_type::static_extent(r);
114 }
115
116 static KOKKOS_FUNCTION constexpr bool is_always_unique() noexcept
117 {
118 return mapping_type::is_always_unique();
119 }
120
121 static KOKKOS_FUNCTION constexpr bool is_always_exhaustive() noexcept
122 {
123 return mapping_type::is_always_exhaustive();
124 }
125
126 static KOKKOS_FUNCTION constexpr bool is_always_strided() noexcept
127 {
128 return mapping_type::is_always_strided();
129 }
130
131private:
132 template <class Mapping = mapping_type>
133 static KOKKOS_FUNCTION constexpr std::
134 enable_if_t<std::is_constructible_v<Mapping, extents_type>, internal_mdspan_type>
135 make_internal_mdspan(ElementType* ptr, discrete_domain_type const& domain)
136 {
137 if (domain.empty()) {
138 return internal_mdspan_type(ptr, Kokkos::layout_stride::mapping<extents_type>());
139 }
140 extents_type const extents_r(::ddc::extents<DDims>(domain).value()...);
141 mapping_type const mapping_r(extents_r);
142
143 extents_type const extents_s((front<DDims>(domain) + ddc::extents<DDims>(domain)).uid()...);
144 std::array<std::size_t, sizeof...(DDims)> const strides_s {
145 mapping_r.stride(type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>)...};
146 Kokkos::layout_stride::mapping<extents_type> const mapping_s(extents_s, strides_s);
147 return internal_mdspan_type(ptr - mapping_s(front<DDims>(domain).uid()...), mapping_s);
148 }
149
150public:
151 KOKKOS_FUNCTION constexpr accessor_type accessor() const
152 {
153 return m_internal_mdspan.accessor();
154 }
155
156 KOKKOS_FUNCTION constexpr DiscreteVector<DDims...> extents() const noexcept
157 {
158 return m_domain.extents();
159 }
160
161 template <class QueryDDim>
162 KOKKOS_FUNCTION constexpr size_type extent() const noexcept
163 {
164 return m_domain.template extent<QueryDDim>();
165 }
166
167 KOKKOS_FUNCTION constexpr size_type size() const noexcept
168 {
169 return allocation_mdspan().size();
170 }
171
172 KOKKOS_FUNCTION constexpr mapping_type mapping() const noexcept
173 {
174 return allocation_mdspan().mapping();
175 }
176
177 KOKKOS_FUNCTION constexpr bool is_unique() const noexcept
178 {
179 return allocation_mdspan().is_unique();
180 }
181
182 KOKKOS_FUNCTION constexpr bool is_exhaustive() const noexcept
183 {
184 return allocation_mdspan().is_exhaustive();
185 }
186
187 KOKKOS_FUNCTION constexpr bool is_strided() const noexcept
188 {
189 return allocation_mdspan().is_strided();
190 }
191
192 template <class QueryDDim>
193 KOKKOS_FUNCTION constexpr size_type stride() const
194 {
195 return m_internal_mdspan.stride(type_seq_rank_v<QueryDDim, detail::TypeSeq<DDims...>>);
196 }
197
198 /** Provide access to the domain on which this chunk is defined
199 * @return the domain on which this chunk is defined
200 */
201 KOKKOS_FUNCTION constexpr discrete_domain_type domain() const noexcept
202 {
203 return m_domain;
204 }
205
206 /** Provide access to the domain on which this chunk is defined
207 * @return the domain on which this chunk is defined
208 */
209 template <class... QueryDDims>
210 KOKKOS_FUNCTION constexpr DiscreteDomain<QueryDDims...> domain() const noexcept
211 {
212 return DiscreteDomain<QueryDDims...>(domain());
213 }
214
215protected:
216 /// Empty ChunkCommon
217 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon() = default;
218
219 /** Constructs a new ChunkCommon from scratch
220 * @param internal_mdspan
221 * @param domain
222 */
224 internal_mdspan_type internal_mdspan,
225 discrete_domain_type const& domain) noexcept
226 : m_internal_mdspan(std::move(internal_mdspan))
227 , m_domain(domain)
228 {
229 }
230
231 /** Constructs a new ChunkCommon from scratch
232 * @param ptr the allocation pointer to the data
233 * @param domain the domain that sustains the view
234 */
235 template <
236 class Mapping = mapping_type,
237 std::enable_if_t<std::is_constructible_v<Mapping, extents_type>, int> = 0>
238 KOKKOS_FUNCTION constexpr ChunkCommon(ElementType* ptr, discrete_domain_type const& domain)
239 : m_internal_mdspan(make_internal_mdspan(ptr, domain))
240 , m_domain(domain)
241 {
242 // Handle the case where an allocation of size 0 returns a nullptr.
243 assert(domain.empty() || ((ptr != nullptr) && !domain.empty()));
244 }
245
246 /** Constructs a new ChunkCommon by copy, yields a new view to the same data
247 * @param other the ChunkCommon to copy
248 */
249 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon const& other) = default;
250
251 /** Constructs a new ChunkCommon by move
252 * @param other the ChunkCommon to move
253 */
254 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon&& other) noexcept = default;
255
256 KOKKOS_DEFAULTED_FUNCTION ~ChunkCommon() noexcept = default;
257
258 /** Copy-assigns a new value to this ChunkCommon, yields a new view to the same data
259 * @param other the ChunkCommon to copy
260 * @return *this
261 */
262 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon& operator=(ChunkCommon const& other) = default;
263
264 /** Move-assigns a new value to this ChunkCommon
265 * @param other the ChunkCommon to move
266 * @return *this
267 */
268 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon& operator=(ChunkCommon&& other) noexcept
269 = default;
270
271 /** Access to the underlying allocation pointer
272 * @return allocation pointer
273 */
274 KOKKOS_FUNCTION constexpr ElementType* data_handle() const
275 {
276 ElementType* ptr = m_internal_mdspan.data_handle();
277 if (!m_domain.empty()) {
278 ptr += m_internal_mdspan.mapping()(front<DDims>(m_domain).uid()...);
279 }
280 return ptr;
281 }
282
283 /** Provide a modifiable view of the data
284 * @return a modifiable view of the data
285 */
286 KOKKOS_FUNCTION constexpr internal_mdspan_type internal_mdspan() const
287 {
288 return m_internal_mdspan;
289 }
290
291 /** Provide a modifiable view of the data
292 * @return a modifiable view of the data
293 */
294 KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
295 {
296 DDC_IF_NVCC_THEN_PUSH_AND_SUPPRESS(implicit_return_from_non_void_function)
297 extents_type const extents_s(::ddc::extents<DDims>(m_domain).value()...);
298 if constexpr (std::is_same_v<LayoutStridedPolicy, Kokkos::layout_stride>) {
299 mapping_type const map(extents_s, m_internal_mdspan.mapping().strides());
300 return allocation_mdspan_type(data_handle(), map);
301 } else {
302 mapping_type const map(extents_s);
303 return allocation_mdspan_type(data_handle(), map);
304 }
305 DDC_IF_NVCC_THEN_POP
306 }
307};
308
309template <class ElementType, class SupportType, class LayoutStridedPolicy>
310class ChunkCommon
311{
312public:
313 using discrete_domain_type = SupportType;
314
315 /// The dereferenceable part of the co-domain but with a different domain, starting at 0
316 using allocation_mdspan_type = Kokkos::mdspan<
317 ElementType,
318 Kokkos::dextents<std::size_t, SupportType::rank()>,
319 LayoutStridedPolicy>;
320
321 using const_allocation_mdspan_type = Kokkos::mdspan<
322 ElementType const,
323 Kokkos::dextents<std::size_t, SupportType::rank()>,
324 LayoutStridedPolicy>;
325
326 using discrete_element_type = typename discrete_domain_type::discrete_element_type;
327
328 using discrete_vector_type = typename discrete_domain_type::discrete_vector_type;
329
330 using extents_type = typename allocation_mdspan_type::extents_type;
331
332 using layout_type = typename allocation_mdspan_type::layout_type;
333
334 using accessor_type = typename allocation_mdspan_type::accessor_type;
335
336 using mapping_type = typename allocation_mdspan_type::mapping_type;
337
338 using element_type = typename allocation_mdspan_type::element_type;
339
340 using value_type = typename allocation_mdspan_type::value_type;
341
342 using size_type = typename allocation_mdspan_type::size_type;
343
344 using data_handle_type = typename allocation_mdspan_type::data_handle_type;
345
346 using reference = typename allocation_mdspan_type::reference;
347
348 // ChunkCommon, ChunkSpan and Chunk need to access to m_allocation_mdspan_mdspan and m_domain of other template versions
349 template <class, class, class>
350 friend class ChunkCommon;
351
352 template <class, class, class, class>
353 friend class ChunkSpan;
354
355 template <class, class, class>
356 friend class Chunk;
357
358 static_assert(mapping_type::is_always_strided());
359
360protected:
361 /// The raw view of the data
362 allocation_mdspan_type m_allocation_mdspan;
363
364 /// The mesh on which this chunk is defined
365 SupportType m_domain;
366
367public:
368 static KOKKOS_FUNCTION constexpr int rank() noexcept
369 {
370 return extents_type::rank();
371 }
372
373 static KOKKOS_FUNCTION constexpr int rank_dynamic() noexcept
374 {
375 return extents_type::rank_dynamic();
376 }
377
378 static KOKKOS_FUNCTION constexpr size_type static_extent(std::size_t r) noexcept
379 {
380 return extents_type::static_extent(r);
381 }
382
383 static KOKKOS_FUNCTION constexpr bool is_always_unique() noexcept
384 {
385 return mapping_type::is_always_unique();
386 }
387
388 static KOKKOS_FUNCTION constexpr bool is_always_exhaustive() noexcept
389 {
390 return mapping_type::is_always_exhaustive();
391 }
392
393 static KOKKOS_FUNCTION constexpr bool is_always_strided() noexcept
394 {
395 return mapping_type::is_always_strided();
396 }
397
398private:
399 template <class Mapping = mapping_type>
400 static KOKKOS_FUNCTION constexpr std::
401 enable_if_t<std::is_constructible_v<Mapping, extents_type>, allocation_mdspan_type>
402 make_allocation_mdspan(ElementType* ptr, SupportType const& domain)
403 {
404 return allocation_mdspan_type(ptr, detail::array(domain.extents()));
405 }
406
407public:
408 KOKKOS_FUNCTION constexpr accessor_type accessor() const
409 {
410 return m_allocation_mdspan.accessor();
411 }
412
413 KOKKOS_FUNCTION constexpr typename SupportType::discrete_vector_type extents() const noexcept
414 {
415 return m_domain.extents();
416 }
417
418 template <class QueryDDim>
419 KOKKOS_FUNCTION constexpr size_type extent() const noexcept
420 {
421 return m_domain.template extent<QueryDDim>();
422 }
423
424 KOKKOS_FUNCTION constexpr size_type size() const noexcept
425 {
426 return allocation_mdspan().size();
427 }
428
429 KOKKOS_FUNCTION constexpr mapping_type mapping() const noexcept
430 {
431 return allocation_mdspan().mapping();
432 }
433
434 KOKKOS_FUNCTION constexpr bool is_unique() const noexcept
435 {
436 return allocation_mdspan().is_unique();
437 }
438
439 KOKKOS_FUNCTION constexpr bool is_exhaustive() const noexcept
440 {
441 return allocation_mdspan().is_exhaustive();
442 }
443
444 KOKKOS_FUNCTION constexpr bool is_strided() const noexcept
445 {
446 return allocation_mdspan().is_strided();
447 }
448
449 template <class QueryDDim>
450 KOKKOS_FUNCTION constexpr size_type stride() const
451 {
452 return m_allocation_mdspan.stride(type_seq_rank_v<QueryDDim, to_type_seq_t<SupportType>>);
453 }
454
455 /** Provide access to the domain on which this chunk is defined
456 * @return the domain on which this chunk is defined
457 */
458 KOKKOS_FUNCTION constexpr SupportType domain() const noexcept
459 {
460 return m_domain;
461 }
462
463 /** Provide access to the domain on which this chunk is defined
464 * @return the domain on which this chunk is defined
465 */
466 template <class... QueryDDims>
467 KOKKOS_FUNCTION constexpr DiscreteDomain<QueryDDims...> domain() const noexcept
468 {
469 return DiscreteDomain<QueryDDims...>(domain());
470 }
471
472protected:
473 /// Empty ChunkCommon
474 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon() = default;
475
476 /** Constructs a new ChunkCommon from scratch
477 * @param allocation_mdspan
478 * @param domain
479 */
481 allocation_mdspan_type allocation_mdspan,
482 SupportType const& domain) noexcept
483 : m_allocation_mdspan(std::move(allocation_mdspan))
484 , m_domain(domain)
485 {
486 }
487
488 /** Constructs a new ChunkCommon from scratch
489 * @param ptr the allocation pointer to the data
490 * @param domain the domain that sustains the view
491 */
492 template <
493 class Mapping = mapping_type,
494 std::enable_if_t<std::is_constructible_v<Mapping, extents_type>, int> = 0>
495 KOKKOS_FUNCTION constexpr ChunkCommon(ElementType* ptr, SupportType const& domain)
496 : m_allocation_mdspan(make_allocation_mdspan(ptr, domain))
497 , m_domain(domain)
498 {
499 // Handle the case where an allocation of size 0 returns a nullptr.
500 assert(domain.empty() || ((ptr != nullptr) && !domain.empty()));
501 }
502
503 /** Constructs a new ChunkCommon by copy, yields a new view to the same data
504 * @param other the ChunkCommon to copy
505 */
506 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon const& other) = default;
507
508 /** Constructs a new ChunkCommon by move
509 * @param other the ChunkCommon to move
510 */
511 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon&& other) noexcept = default;
512
513 KOKKOS_DEFAULTED_FUNCTION ~ChunkCommon() noexcept = default;
514
515 /** Copy-assigns a new value to this ChunkCommon, yields a new view to the same data
516 * @param other the ChunkCommon to copy
517 * @return *this
518 */
519 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon& operator=(ChunkCommon const& other) = default;
520
521 /** Move-assigns a new value to this ChunkCommon
522 * @param other the ChunkCommon to move
523 * @return *this
524 */
525 KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon& operator=(ChunkCommon&& other) noexcept
526 = default;
527
528 /** Access to the underlying allocation pointer
529 * @return allocation pointer
530 */
531 KOKKOS_FUNCTION constexpr ElementType* data_handle() const
532 {
533 return m_allocation_mdspan.data_handle();
534 }
535
536 /** Provide a modifiable view of the data
537 * @return a modifiable view of the data
538 */
539 KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
540 {
541 return m_allocation_mdspan;
542 }
543};
544
545} // namespace ddc
KOKKOS_FUNCTION constexpr mapping_type mapping() const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon const &other)=default
Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.
KOKKOS_FUNCTION constexpr discrete_domain_type domain() const noexcept
Provide access to the domain on which this chunk is defined.
discrete_domain_type m_domain
The mesh on which this chunk is defined.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon const &other)=default
Constructs a new ChunkCommon by copy, yields a new view to the same data.
KOKKOS_FUNCTION constexpr DiscreteVector< DDims... > extents() const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon()=default
Empty ChunkCommon.
KOKKOS_FUNCTION constexpr ElementType * data_handle() const
Access to the underlying allocation pointer.
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
Provide a modifiable view of the data.
KOKKOS_FUNCTION constexpr ChunkCommon(internal_mdspan_type internal_mdspan, discrete_domain_type const &domain) noexcept
Constructs a new ChunkCommon from scratch.
KOKKOS_FUNCTION constexpr internal_mdspan_type internal_mdspan() const
Provide a modifiable view of the data.
static KOKKOS_FUNCTION constexpr size_type static_extent(std::size_t r) noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon &&other) noexcept=default
Constructs a new ChunkCommon by move.
KOKKOS_FUNCTION constexpr ChunkCommon(ElementType *ptr, discrete_domain_type const &domain)
Constructs a new ChunkCommon from scratch.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon &&other) noexcept=default
Move-assigns a new value to this ChunkCommon.
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > domain() const noexcept
Provide access to the domain on which this chunk is defined.
KOKKOS_FUNCTION constexpr bool is_strided() const noexcept
KOKKOS_DEFAULTED_FUNCTION ~ChunkCommon() noexcept=default
KOKKOS_FUNCTION constexpr ElementType * data_handle() const
Access to the underlying allocation pointer.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon()=default
Empty ChunkCommon.
allocation_mdspan_type m_allocation_mdspan
The raw view of the data.
KOKKOS_FUNCTION constexpr SupportType domain() const noexcept
Provide access to the domain on which this chunk is defined.
static KOKKOS_FUNCTION constexpr bool is_always_strided() noexcept
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
Provide a modifiable view of the data.
KOKKOS_FUNCTION constexpr ChunkCommon(allocation_mdspan_type allocation_mdspan, SupportType const &domain) noexcept
Constructs a new ChunkCommon from scratch.
KOKKOS_FUNCTION constexpr ChunkCommon(ElementType *ptr, SupportType const &domain)
Constructs a new ChunkCommon from scratch.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon const &other)=default
Constructs a new ChunkCommon by copy, yields a new view to the same data.
static KOKKOS_FUNCTION constexpr bool is_always_unique() noexcept
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > domain() const noexcept
Provide access to the domain on which this chunk is defined.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon const &other)=default
Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon &&other) noexcept=default
Constructs a new ChunkCommon by move.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon &&other) noexcept=default
Move-assigns a new value to this ChunkCommon.
KOKKOS_FUNCTION constexpr size_type extent() const noexcept
KOKKOS_FUNCTION constexpr size_type stride() const
KOKKOS_FUNCTION constexpr bool is_exhaustive() const noexcept
KOKKOS_FUNCTION constexpr mapping_type mapping() const noexcept
static KOKKOS_FUNCTION constexpr int rank() noexcept
KOKKOS_FUNCTION constexpr bool is_unique() const noexcept
KOKKOS_FUNCTION constexpr accessor_type accessor() const
KOKKOS_FUNCTION constexpr SupportType::discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr size_type size() const noexcept
SupportType m_domain
The mesh on which this chunk is defined.
static KOKKOS_FUNCTION constexpr int rank_dynamic() noexcept
static KOKKOS_FUNCTION constexpr size_type static_extent(std::size_t r) noexcept
static KOKKOS_FUNCTION constexpr bool is_always_exhaustive() noexcept
friend class DiscreteDomain
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
The top-level namespace of DDC.
KOKKOS_FUNCTION auto get_domain(ChunkType const &chunk) noexcept
Access the domain (or subdomain) of a view.