kokkos-execution 0.0.1
Loading...
Searching...
No Matches
dispatch_label.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL_HPP
2#define KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL_HPP
3
4#include <algorithm>
5#include <array>
6#include <string_view>
7
8#include "Kokkos_Core.hpp"
9
11
12template <size_t N>
14 char data[N]{};
15
16 consteval FixedString(const char (&str)[N]) noexcept { // NOLINT(google-explicit-constructor)
17 std::copy_n(str, N, data);
18 }
19
20 consteval auto size() const {
21 return N - 1;
22 }
23
24 consteval auto begin() const {
25 return data;
26 }
27 consteval auto end() const {
28 return data + N - 1;
29 }
30};
31
33template <Kokkos::ExecutionSpace Exec, FixedString Suffix>
34static constexpr auto dispatch_label_v = [] {
35 constexpr auto prefix = Kokkos::Impl::TypeInfo<Exec>::name();
36 std::array<char, prefix.size() + Suffix.size() + 1> buf{};
37 auto iter = buf.begin();
38 for (auto charac: prefix)
39 *iter++ = charac;
40 for (auto charac: Suffix)
41 *iter++ = charac;
42 return buf;
43}();
44
46template <Kokkos::ExecutionSpace Exec, FixedString Suffix>
47consteval std::string_view dispatch_label() noexcept {
49}
50
51} // namespace Kokkos::Execution::Impl
52
53#endif // KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL_HPP
static constexpr auto dispatch_label_v
Get the dispatch label from Exec and Suffix.
consteval std::string_view dispatch_label() noexcept
View the dispatch label as a std::string_view.
consteval FixedString(const char(&str)[N]) noexcept