kokkos-utils
0.0.1
Loading...
Searching...
No Matches
extents.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_UTILS_VIEW_EXTENTS_HPP
2
#define KOKKOS_UTILS_VIEW_EXTENTS_HPP
3
4
#include "
kokkos-utils/concepts/View.hpp
"
5
12
13
namespace
Kokkos::utils::view
14
{
15
16
namespace
impl
17
{
18
20
template
<
concepts::View
ViewType,
size_t
... Ints>
21
KOKKOS_FUNCTION
22
constexpr
auto
extents
(
const
ViewType&
view
, std::index_sequence<Ints...>)
23
{
24
Kokkos::Array<size_t,
sizeof
...(Ints)>
extents
{};
25
((
extents
[Ints] =
view
.extent(Ints)), ...);
26
return
extents
;
27
}
28
29
}
// namespace impl
30
32
template
<concepts::View ViewType>
33
KOKKOS_FUNCTION
34
constexpr
auto
extents
(
const
ViewType&
view
)
35
{
36
constexpr
auto
rank = ViewType::rank();
37
constexpr
auto
dims = std::make_index_sequence<rank>{};
38
return
impl::extents
(
view
, dims);
39
}
40
41
}
// namespace Kokkos::utils::view
42
43
#endif
// KOKKOS_UTILS_VIEW_EXTENTS_HPP
View.hpp
Kokkos::utils::concepts::View
Specify that a type is a Kokkos::View.
Definition
View.hpp:15
Kokkos::utils::view::impl
Definition
extents.hpp:17
Kokkos::utils::view::impl::extents
KOKKOS_FUNCTION constexpr auto extents(const ViewType &view, std::index_sequence< Ints... >)
Implementation of Kokkos::utils::view::extents.
Definition
extents.hpp:22
Kokkos::utils::view
Definition
extents.hpp:14
Kokkos::utils::view::extents
KOKKOS_FUNCTION constexpr auto extents(const ViewType &view)
Get all extents of view.
Definition
extents.hpp:34
include
kokkos-utils
view
extents.hpp
Generated on Thu Apr 17 2025 12:50:27 for kokkos-utils by
1.13.2