kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
iteration_space.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_IMPL_ITERATION_SPACE_HPP
2
#define KOKKOS_EXECUTION_IMPL_ITERATION_SPACE_HPP
3
4
#include <type_traits>
5
6
#include "Kokkos_Macros.hpp"
7
#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
8
import
kokkos.core;
9
import
kokkos.execution.mdspan;
10
#else
11
# include "Kokkos_Core.hpp"
12
#endif
13
14
namespace
Kokkos::Execution::Impl
{
15
16
template
<
typename
T>
17
concept
extents
= Kokkos::detail::impl_is_extents_v<T>;
18
19
template
<
typename
T>
20
concept
range_slice
= Kokkos::detail::is_range_slice<T>::value;
21
22
template
<
typename
T>
23
concept
range_slice_with_default_stride
=
range_slice<T>
24
&& Kokkos::detail::is_constant_wrapper<decltype(std::declval<T>().stride)>
25
&&
requires
(
const
T& rgsl) { rgsl.stride == 1; };
26
28
template
<
typename
T>
29
concept
iteration_space
= (
extents<T>
&&
requires
{ T::rank() == 1; }) ||
range_slice_with_default_stride<T>
;
30
31
template
<
typename
T>
32
concept
execution_policy_or_iteration_space
= Kokkos::ExecutionPolicy<T> ||
iteration_space<T>
;
33
35
template
<std::
int
egral T>
36
constexpr
auto
make_iter_space
(
const
T work_count)
noexcept
-> Kokkos::dims<1, T> {
37
return
Kokkos::dims<1, T>{work_count};
38
}
39
40
}
// namespace Kokkos::Execution::Impl
41
42
#endif
// KOKKOS_EXECUTION_IMPL_ITERATION_SPACE_HPP
Kokkos::Execution::Impl::execution_policy_or_iteration_space
Definition
iteration_space.hpp:32
Kokkos::Execution::Impl::extents
Definition
iteration_space.hpp:17
Kokkos::Execution::Impl::iteration_space
Concept that constrains types that may represent an iteration space.
Definition
iteration_space.hpp:29
Kokkos::Execution::Impl::range_slice_with_default_stride
Definition
iteration_space.hpp:23
Kokkos::Execution::Impl::range_slice
Definition
iteration_space.hpp:20
Kokkos::Execution::Impl
Definition
attributes.hpp:6
Kokkos::Execution::Impl::make_iter_space
constexpr auto make_iter_space(const T work_count) noexcept -> Kokkos::dims< 1, T >
Make a valid iteration space from a work count.
Definition
iteration_space.hpp:36
kokkos-execution
impl
iteration_space.hpp
Generated on
for kokkos-execution by
1.18.0