kokkos-execution
0.0.1
Loading...
Searching...
No Matches
test_sync_wait.cpp
Go to the documentation of this file.
1
#include "
kokkos-utils/callbacks/RecorderListener.hpp
"
2
#include "
kokkos-utils/tests/scoped/callbacks/Manager.hpp
"
3
4
#include "
kokkos-execution/graph.hpp
"
5
6
#include "
tests/utils/callback_matchers.hpp
"
7
#include "
tests/utils/check_sync_wait.hpp
"
8
#include "
tests/utils/graph_context.hpp
"
9
#include "
tests/utils/stdexec.hpp
"
10
22
23
namespace
Tests::GraphImpl
{
24
25
using namespace
Kokkos::utils::callbacks;
26
27
class
SyncWaitTest
28
:
public
Tests::Utils::GraphContextTest
<TEST_EXECUTION_SPACE>
29
,
public
Kokkos::utils::tests::scoped::callbacks::Manager
{
30
public
:
31
using
recorder_listener_t
=
RecorderListener<EventDiscardMatcher<TEST_EXECUTION_SPACE>
,
BeginFenceEvent
>;
32
};
33
35
static_assert
(
Tests::Utils::check_nothrow_apply_sender
<
36
Kokkos::Execution::GraphImpl::Domain
,
37
typename
SyncWaitTest::schedule_sender_t
38
>());
39
41
TEST_F(
SyncWaitTest
, sync_wait) {
42
const
context_t
gctx{
exec
};
43
44
auto
sndr = stdexec::schedule(gctx.
get_scheduler
());
45
46
ASSERT_THAT(
47
recorder_listener_t::record([sndr = std::move(sndr)]()
mutable
{
// NOLINT(performance-move-const-arg)
48
const
auto
value = stdexec::sync_wait(std::move(sndr));
// NOLINT(performance-move-const-arg)
49
static_assert
(std::same_as<
decltype
(value),
const
std::optional<std::tuple<>>>);
50
ASSERT_TRUE(value.has_value());
51
}),
52
testing::IsEmpty());
53
}
54
55
}
// namespace Tests::GraphImpl
RecorderListener.hpp
callback_matchers.hpp
check_sync_wait.hpp
Kokkos::utils::callbacks::RecorderListener
Tests::GraphImpl::SyncWaitTest
Definition
test_sync_wait.cpp:29
Tests::GraphImpl::SyncWaitTest::recorder_listener_t
RecorderListener< EventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent > recorder_listener_t
Definition
test_sync_wait.cpp:31
graph.hpp
graph_context.hpp
Tests::GraphImpl
Definition
events.hpp:8
Tests::Utils::check_nothrow_apply_sender
consteval bool check_nothrow_apply_sender()
Definition
check_sync_wait.hpp:10
Kokkos::Execution::GraphContext::get_scheduler
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Definition
graph.hpp:117
Kokkos::Execution::GraphImpl::Domain
Definition
domain.hpp:13
Kokkos::utils::callbacks::BeginFenceEvent
Kokkos::utils::tests::scoped::ExecutionSpace< Exec >::exec
Exec exec
Kokkos::utils::tests::scoped::callbacks::Manager
Tests::Utils::ContextTest< Kokkos::Execution::GraphContext, Exec >::schedule_sender_t
decltype(stdexec::schedule(std::declval< scheduler_t >())) schedule_sender_t
Definition
context.hpp:29
Tests::Utils::ContextTest< Kokkos::Execution::GraphContext, Exec >::context_t
Kokkos::Execution::GraphContext< Exec > context_t
Definition
context.hpp:27
Tests::Utils::GraphContextTest
Definition
graph_context.hpp:14
Manager.hpp
stdexec.hpp
tests
graph
test_sync_wait.cpp
Generated on
for kokkos-execution by
1.15.0