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_Core.hpp"
7
9
15template <stdexec::sender Sndr>
17 mutable Sndr sndr;
18
19 void operator()() const {
20 stdexec::sync_wait(std::move(sndr));
21 }
22};
23
31 ThrowsWhenCopied() = default;
35 ~ThrowsWhenCopied() = default;
36
38 throw std::runtime_error("ThrowsWhenCopied: Throwing in copy constructor!");
39 }
40
41 KOKKOS_FUNCTION
42 void operator()() const {
43 Kokkos::abort("ThrowsWhenCopied: This is not intended to be called!");
44 }
45};
46
47} // namespace Tests::Utils::Functors
48
49#endif // KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_THROWS_WHEN_COPIED_HPP
ThrowsWhenCopied & operator=(const ThrowsWhenCopied &)=default
ThrowsWhenCopied & operator=(ThrowsWhenCopied &&)=default
ThrowsWhenCopied(ThrowsWhenCopied &&)=default