kokkos-execution 0.0.1
Loading...
Searching...
No Matches
Tests::Utils Namespace Reference

Namespaces

namespace  Functors

Classes

struct  CheckRcvrEnvSender
struct  check_rcvr_env_t
 Check that the receiver environment is of type ExpectedEnv. More...
struct  CheckRcvrEnvQueryableWithSender
struct  check_rcvr_env_queryable_with_t
struct  CheckSchedulerTypeSender
struct  check_scheduler_type_t
struct  ContextTest
struct  DomainInheritingFromDefault
struct  ExecutionSpaceContextTest
struct  GraphContextTest
struct  SinkReceiver
 A receiver that can handle all completions and does nothing with them. More...
struct  TrackingAllocator
 A minimal tracking allocator. More...

Concepts

concept  has_completion_signatures
concept  has_completion_scheduler_for
concept  operation_state
 A stricter variant of stdexec::operation_state.
concept  has_nothrow_apply_sender
 Check that apply_sender is noexcept.

Typedefs

template<typename... Args>
using basic_sender_t = typename stdexec::__basic_sender<Args...>::type
 See https://github.com/NVIDIA/stdexec/pull/1873#discussion_r2834863237.

Functions

template<typename T>
void atomic_add (T *ptr, const T val)
 Atomically add val to *ptr using system scope and relaxed memory order.
template<stdexec::scheduler Schd>
consteval bool check_continues_on ()
 Check how the scheduler customizes stdexec::continues_on.
template<stdexec::scheduler SchedulerType>
consteval bool check_scheduler ()
 Check that the given type models the stdexec::scheduler concept.
template<typename Domain, stdexec::sender Sndr>
consteval bool check_nothrow_apply_sender ()
template<typename DomainType>
consteval bool check_if_common_domain_is_default ()
 Check if a domain has the stdexec::default_domain as common domain with a few other domains.
template<typename DomainType, typename Tag, stdexec::sender ScheduleSenderType, typename... Args>
consteval bool check_if_domain_has_transform_sender_for ()
 Check if the domain has a transform of a Tag sender.
template<typename DomainType, typename Tag, stdexec::sender ScheduleSenderType, typename... Args>
consteval bool check_if_default_domain_like_for ()
 Check if the domain's transform of a Tag sender is "default-like".
template<typename SchedulerType, typename Tag, typename... Args>
consteval bool check_continues_on_after_just_stopped ()
template<Kokkos::ExecutionSpace Exec, Kokkos::ExecutionSpace OtherExec>
bool are_same_instances (const Exec &exec, const OtherExec &other_exec)
template<Kokkos::ExecutionSpace Exec>
constexpr bool on_device ()
template<Kokkos::ExecutionSpace Exec>
void show_exec_space_id (const Exec &exec, std::string_view label="", std::ostream &out=std::cout)
template<stdexec::__is_instance_of< Kokkos::utils::callbacks::RecorderListener > RecorderListenerType, stdexec::sender Sndr>
auto record_sync_wait (Sndr &&sndr)
template<typename Allocator, typename T>
auto round_trip_allocate (Allocator &allocator, T &&value)

Variables

template<typename ExpectedEnv>
constexpr check_rcvr_env_t< ExpectedEnv > check_rcvr_env {}
template<typename... Queries>
constexpr check_rcvr_env_queryable_with_t< true, Queries... > check_rcvr_env_queryable_with {}
template<typename... Queries>
constexpr check_rcvr_env_queryable_with_t< false, Queries... > check_rcvr_env_not_queryable_with {}
template<typename Tag, stdexec::scheduler Schd>
constexpr check_scheduler_type_t< Tag, Schd > check_scheduler_type {}

Typedef Documentation

◆ basic_sender_t

template<typename... Args>
using Tests::Utils::basic_sender_t = typename stdexec::__basic_sender<Args...>::type

Function Documentation

◆ are_same_instances()

template<Kokkos::ExecutionSpace Exec, Kokkos::ExecutionSpace OtherExec>
bool Tests::Utils::are_same_instances ( const Exec & exec,
const OtherExec & other_exec )

Definition at line 13 of file kokkos.hpp.

◆ atomic_add()

template<typename T>
void Tests::Utils::atomic_add ( T * ptr,
const T val )

Atomically add val to *ptr using system scope and relaxed memory order.

Definition at line 34 of file atomic.hpp.

◆ check_continues_on()

template<stdexec::scheduler Schd>
bool Tests::Utils::check_continues_on ( )
consteval

Check how the scheduler customizes stdexec::continues_on.

Use this function to ensure your own scheduler is properly customizing everything that's needed.

Check the complete "demangled" sender type.

Diagnose any issue that could make the resulting sender invalid.

Check the completing domain;

It must advertise a valid completion scheduler.

Handle the case of dependent senders.

Definition at line 20 of file check_continues_on.hpp.

◆ check_continues_on_after_just_stopped()

template<typename SchedulerType, typename Tag, typename... Args>
bool Tests::Utils::check_continues_on_after_just_stopped ( )
consteval

Trying to pass the sender to stdexec::sync_wait will fail on the static_assert in https://github.com/NVIDIA/stdexec/blob/7c8c3c3d5a0d0b16963a00192dbfae5db9c2c627/include/stdexec/__detail/__sync_wait.hpp#L199-L219.

Definition at line 11 of file just_stopped.hpp.

◆ check_if_common_domain_is_default()

template<typename DomainType>
bool Tests::Utils::check_if_common_domain_is_default ( )
consteval

Check if a domain has the stdexec::default_domain as common domain with a few other domains.

Definition at line 14 of file domain.hpp.

◆ check_if_default_domain_like_for()

template<typename DomainType, typename Tag, stdexec::sender ScheduleSenderType, typename... Args>
bool Tests::Utils::check_if_default_domain_like_for ( )
consteval

Check if the domain's transform of a Tag sender is "default-like".

Inspired by https://github.com/NVIDIA/stdexec/blob/b06fe4b00d25f226c87d23e7ba1e564c2c878a15/include/stdexec/__detail/__domain.hpp#L98-L102.

Definition at line 34 of file domain.hpp.

◆ check_if_domain_has_transform_sender_for()

template<typename DomainType, typename Tag, stdexec::sender ScheduleSenderType, typename... Args>
bool Tests::Utils::check_if_domain_has_transform_sender_for ( )
consteval

Check if the domain has a transform of a Tag sender.

Definition at line 21 of file domain.hpp.

◆ check_nothrow_apply_sender()

template<typename Domain, stdexec::sender Sndr>
bool Tests::Utils::check_nothrow_apply_sender ( )
consteval
Test
Check whether the sender can be nothrow applied for stdexec::sync_wait.

Definition at line 10 of file check_sync_wait.hpp.

◆ check_scheduler()

template<stdexec::scheduler SchedulerType>
bool Tests::Utils::check_scheduler ( )
consteval

Check that the given type models the stdexec::scheduler concept.

According to https://eel.is/c++draft/exec.sched#1, a valid scheduler must have a scheduler_concept alias. However, as of https://github.com/NVIDIA/stdexec/blob/0e9983599d0c95fca3fd11baa02564eb53fb14f6/include/stdexec/__detail/__schedulers.hpp#L74, it is not checked by stdexec::scheduler.

Related to https://github.com/NVIDIA/stdexec/issues/1406.

According to https://eel.is/c++draft/exec.sched#1, a schedule invocation must return a sender.

Definition at line 10 of file check_scheduler.hpp.

◆ on_device()

template<Kokkos::ExecutionSpace Exec>
bool Tests::Utils::on_device ( )
constexpr

Definition at line 22 of file kokkos.hpp.

◆ record_sync_wait()

template<stdexec::__is_instance_of< Kokkos::utils::callbacks::RecorderListener > RecorderListenerType, stdexec::sender Sndr>
auto Tests::Utils::record_sync_wait ( Sndr && sndr)

Definition at line 14 of file sync_wait.hpp.

◆ round_trip_allocate()

template<typename Allocator, typename T>
auto Tests::Utils::round_trip_allocate ( Allocator & allocator,
T && value )

Allocate one T through alloc, copy construct in-place from value, then deallocate.

Returns
The value that was copy-constructed.

Definition at line 39 of file tracking_allocator.hpp.

◆ show_exec_space_id()

template<Kokkos::ExecutionSpace Exec>
void Tests::Utils::show_exec_space_id ( const Exec & exec,
std::string_view label = "",
std::ostream & out = std::cout )

Definition at line 33 of file kokkos.hpp.

Variable Documentation

◆ check_rcvr_env

template<typename ExpectedEnv>
check_rcvr_env_t<ExpectedEnv> Tests::Utils::check_rcvr_env {}
inlineconstexpr

Definition at line 50 of file check_rcvr_env.hpp.

◆ check_rcvr_env_not_queryable_with

template<typename... Queries>
check_rcvr_env_queryable_with_t<false, Queries...> Tests::Utils::check_rcvr_env_not_queryable_with {}
inlineconstexpr

Definition at line 78 of file check_rcvr_env_queryable_with.hpp.

◆ check_rcvr_env_queryable_with

template<typename... Queries>
check_rcvr_env_queryable_with_t<true, Queries...> Tests::Utils::check_rcvr_env_queryable_with {}
inlineconstexpr

Definition at line 75 of file check_rcvr_env_queryable_with.hpp.

◆ check_scheduler_type

template<typename Tag, stdexec::scheduler Schd>
check_scheduler_type_t<Tag, Schd> Tests::Utils::check_scheduler_type {}
inlineconstexpr

Definition at line 85 of file check_scheduler_type.hpp.