kokkos-execution 0.0.1
Loading...
Searching...
No Matches
context.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_CONTEXT_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_CONTEXT_HPP
3
4#include "gtest/gtest.h"
5
7
8#include "Kokkos_Core.hpp"
9
10#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
11# include "plog/Formatters/TxtFormatter.h"
12# include "plog/Initializers/ConsoleInitializer.h"
13# include "plog/Log.h"
14#endif
15
17
18namespace Tests::Utils {
19
20template <template <typename> typename ContextType, Kokkos::ExecutionSpace Exec>
22 : public virtual testing::Test
24 public:
25 using context_t = ContextType<Exec>;
26 using scheduler_t = decltype(std::declval<const context_t>().get_scheduler());
27 using schedule_sender_t = decltype(stdexec::schedule(std::declval<scheduler_t>()));
28
29 using value_t = int;
30 using view_s_t = Kokkos::View<value_t, Kokkos::SharedSpace>;
31
32 public:
33#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
34 static void SetUpTestSuite() {
35 plog::init<plog::TxtFormatter>(plog::debug, plog::streamStdOut);
36 }
37#endif
38};
39
40} // namespace Tests::Utils
41
42#endif // KOKKOS_EXECUTION_TESTS_UTILS_CONTEXT_HPP
decltype(std::declval< const context_t >().get_scheduler()) scheduler_t
Definition context.hpp:26
decltype(stdexec::schedule(std::declval< scheduler_t >())) schedule_sender_t
Definition context.hpp:27
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Definition context.hpp:30
ContextType< Exec > context_t
Definition context.hpp:25