kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
test_check_completion_scheduler_type.cpp
Go to the documentation of this file.
1
#include "gtest/gtest.h"
2
3
#include "
kokkos-execution/utils/ignore_warnings.hpp
"
4
PRAGMA_DIAGNOSTIC_PUSH
5
KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
6
#include "exec/split.hpp"
7
#include "exec/static_thread_pool.hpp"
8
PRAGMA_DIAGNOSTIC_POP
9
10
#include "
kokkos-execution/stdexec.hpp
"
11
12
#include "
tests/utils/check_completion_scheduler_type.hpp
"
13
#include "
tests/utils/functors/show_thread_id.hpp
"
14
#include "
tests/utils/functors/store_thread_id.hpp
"
15
26
27
namespace
Tests
{
28
29
using
run_loop_scheduler_t
= stdexec::run_loop::scheduler;
30
using
static_thread_pool_scheduler_t
= experimental::execution::_pool::_static_thread_pool::scheduler;
31
33
TEST(check_completion_scheduler,
default
) {
34
std::thread::id tid;
35
36
stdexec::sync_wait(
37
stdexec::just() |
Tests::Utils::check_completion_scheduler_type<stdexec::set_value_t, run_loop_scheduler_t>
()
38
|
THEN_STORE_THREAD_ID
(&tid));
39
40
ASSERT_EQ(tid, std::this_thread::get_id());
41
}
42
44
TEST(check_completion_scheduler, static_thread_pool) {
45
std::thread::id tid;
46
47
experimental::execution::static_thread_pool pool{1};
48
49
auto
chain = stdexec::schedule(pool.get_scheduler())
50
|
Tests::Utils::check_completion_scheduler_type<stdexec::set_value_t, static_thread_pool_scheduler_t>
()
51
|
THEN_STORE_THREAD_ID
(&tid);
52
53
stdexec::sync_wait(std::move(chain));
// NOLINT(performance-move-const-arg)
54
55
ASSERT_NE(tid, std::this_thread::get_id());
56
}
57
58
}
// namespace Tests
check_completion_scheduler_type.hpp
ignore_warnings.hpp
KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
#define KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
Basic list of ignored diagnostics when including anything from stdexec.
Definition
ignore_warnings.hpp:44
stdexec.hpp
Tests::Utils::check_completion_scheduler_type
constexpr check_completion_scheduler_type_t< Tag, Schd > check_completion_scheduler_type
Definition
check_completion_scheduler_type.hpp:76
Tests
Definition
test_any_sender.cpp:39
Tests::static_thread_pool_scheduler_t
experimental::execution::_pool::_static_thread_pool::scheduler static_thread_pool_scheduler_t
Definition
test_check_completion_scheduler_type.cpp:30
Tests::run_loop_scheduler_t
stdexec::run_loop::scheduler run_loop_scheduler_t
Definition
test_check_completion_scheduler_type.cpp:29
show_thread_id.hpp
store_thread_id.hpp
THEN_STORE_THREAD_ID
#define THEN_STORE_THREAD_ID(__id__)
Add a stdexec::then calling Tests::Utils::Functors::StoreThreadID. // NOLINTNEXTLINE(cppcoreguideline...
Definition
store_thread_id.hpp:20
tests
utils
test_check_completion_scheduler_type.cpp
Generated on
for kokkos-execution by
1.18.0