kokkos-execution 0.0.1
Loading...
Searching...
No Matches
no_op.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_NO_OP_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_NO_OP_HPP
3
4#include "Kokkos_Macros.hpp"
5#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
6import kokkos.core;
7#else
8# include "Kokkos_Core.hpp"
9#endif
10
11namespace Tests::Utils::Functors {
12
14template <bool MayThrowOnCall = true, bool MayThrowOnCopy = true, bool MayThrowOnMove = true>
15struct NoOp {
16 NoOp() = default;
17
18 constexpr NoOp(const NoOp&) noexcept(!MayThrowOnCopy) { // NOLINT(modernize-use-equals-default)
19 }
20
21 constexpr NoOp(NoOp&&) noexcept(!MayThrowOnMove) {
22 }
23
24 constexpr NoOp& operator=(const NoOp&) noexcept(!MayThrowOnCopy) { // NOLINT(modernize-use-equals-default)
25 return *this;
26 }
27
28 constexpr NoOp& operator=(NoOp&&) noexcept(!MayThrowOnMove) {
29 return *this;
30 }
31
32 ~NoOp() = default;
33
34 template <typename... Args>
35 KOKKOS_FUNCTION constexpr void operator()(Args&&...) const noexcept(!MayThrowOnCall) {
36 }
37};
38
39} // namespace Tests::Utils::Functors
40
41#endif // KOKKOS_EXECUTION_TESTS_UTILS_FUNCTORS_NO_OP_HPP
constexpr NoOp & operator=(const NoOp &) noexcept(!MayThrowOnCopy)
Definition no_op.hpp:24
constexpr NoOp & operator=(NoOp &&) noexcept(!MayThrowOnMove)
Definition no_op.hpp:28
constexpr void operator()(Args &&...) const noexcept(!MayThrowOnCall)
Definition no_op.hpp:35
constexpr NoOp(NoOp &&) noexcept(!MayThrowOnMove)
Definition no_op.hpp:21
constexpr NoOp(const NoOp &) noexcept(!MayThrowOnCopy)
Definition no_op.hpp:18