kokkos-execution 0.0.1
Loading...
Searching...
No Matches
label.hpp File Reference
#include "Kokkos_Macros.hpp"
#include "Kokkos_Core.hpp"
#include "kokkos-execution/impl/fixed_string.hpp"
#include "kokkos-execution/impl/properties.hpp"

Go to the source code of this file.

Classes

struct  Kokkos::Execution::Impl::Label< T >
 Label property. More...

Namespaces

namespace  Kokkos
namespace  Kokkos::Execution
namespace  Kokkos::Execution::Impl

Concepts

concept  Kokkos::Execution::Impl::label
 Constrain the accepted label types.
concept  Kokkos::Execution::Impl::labeled

Functions

template<typename T>
requires std::convertible_to<T, std::string>
constexpr auto Kokkos::Execution::Impl::as_convertible_to_string (T &&value) noexcept(noexcept(std::forward< T >(value))) -> decltype(std::forward< T >(value))
 Convert to a value usable as a std::string.
template<typename T>
requires (!std::convertible_to<T, std::string>)
constexpr auto Kokkos::Execution::Impl::as_convertible_to_string (T &&value) noexcept(noexcept(static_cast< std::string >(std::forward< T >(value)))) -> decltype(static_cast< std::string >(std::forward< T >(value)))
CTAD for @ref Label.
template<std::convertible_to< std::string > T>
 Kokkos::Execution::Impl::Label (T) -> Label< std::string >
template<typename T>
 Kokkos::Execution::Impl::Label (T) -> Label< T >
Marker for a string literal.

Pre-C++26 has no way to determine if an incoming pointer is a string literal. See also [2].

consteval Impl::Label< std::string_view > Kokkos::Execution::label (std::string_view str) noexcept

Detailed Description

This file contains the label property and related helpers.

If the incoming type is already a Kokkos::Execution::Impl::Label, it should be kept as is. Otherwise, if the type is not convertible to std::string, a new std::string will be materialized.

In order to pass a std::string_view, the user has to use Kokkos::Execution::label, thus enforcing that the std::string_view points to static storage.

Definition in file label.hpp.