kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_check_completion_scheduler_type.cpp
Go to the documentation of this file.
1#include "gtest/gtest.h"
2
4PRAGMA_DIAGNOSTIC_PUSH
6#include "exec/split.hpp"
7#include "exec/static_thread_pool.hpp"
8PRAGMA_DIAGNOSTIC_POP
9
11
15
26
27namespace Tests {
28
29using run_loop_scheduler_t = stdexec::run_loop::scheduler;
30using static_thread_pool_scheduler_t = experimental::execution::_pool::_static_thread_pool::scheduler;
31
33TEST(check_completion_scheduler, default) {
34 std::thread::id tid;
35
36 stdexec::sync_wait(
38 | THEN_STORE_THREAD_ID(&tid));
39
40 ASSERT_EQ(tid, std::this_thread::get_id());
41}
42
44TEST(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())
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
#define KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
Basic list of ignored diagnostics when including anything from stdexec.
constexpr check_completion_scheduler_type_t< Tag, Schd > check_completion_scheduler_type
experimental::execution::_pool::_static_thread_pool::scheduler static_thread_pool_scheduler_t
stdexec::run_loop::scheduler run_loop_scheduler_t
#define THEN_STORE_THREAD_ID(__id__)
Add a stdexec::then calling Tests::Utils::Functors::StoreThreadID. // NOLINTNEXTLINE(cppcoreguideline...