kokkos-execution 0.0.1
Loading...
Searching...
No Matches
throws_when_copied.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_THROWS_WHEN_COPIED_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_THROWS_WHEN_COPIED_HPP
3
5
6#include "Kokkos_Macros.hpp"
7#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
8import kokkos.core;
9#else
10# include "Kokkos_Core.hpp"
11#endif
12
13namespace Tests::Utils::Functors {
14
20template <stdexec::sender Sndr>
22 mutable Sndr sndr;
23
24 void operator()() const {
25 stdexec::sync_wait(std::move(sndr));
26 }
27};
28
36 ThrowsWhenCopied() = default;
40 ~ThrowsWhenCopied() = default;
41
42#if defined(__cpp_constexpr_exceptions)
43 constexpr
44#endif
46 throw std::runtime_error("ThrowsWhenCopied: Throwing in copy constructor!");
47 }
48
49 KOKKOS_FUNCTION
50 void operator()() const {
51 Kokkos::abort("ThrowsWhenCopied: This is not intended to be called!");
52 }
53};
54
55} // namespace Tests::Utils::Functors
56
57#endif // KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_THROWS_WHEN_COPIED_HPP
ThrowsWhenCopied & operator=(const ThrowsWhenCopied &)=default
ThrowsWhenCopied & operator=(ThrowsWhenCopied &&)=default
ThrowsWhenCopied(ThrowsWhenCopied &&)=default