Mneme
Mneme a tool allowing recording the execution of a GPU (CUDA/HIP) kernel and replaying that kernel as an independent executable.
Loading...
Searching...
No Matches
MnemeRecordScope.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace mneme {
4
5namespace detail {
6// Internal function used by launcher to check if recording is allowed
7// state is owned by the shared mnemert runtime.
8bool scopeAllowsRecording(const void *Kernel) noexcept;
9} // namespace detail
10
12public:
13 [[nodiscard]] explicit record_scope(bool Enabled) noexcept;
14
15 template <typename T> record_scope(T *) = delete;
16
17 template <typename Return, typename... Args>
18 [[nodiscard]] record_scope(Return (*Kernel)(Args...), bool Enabled)
19 : record_scope(reinterpret_cast<const void *>(Kernel), Enabled) {}
20
21 ~record_scope() noexcept;
22
23 record_scope(const record_scope &) = delete;
24 record_scope &operator=(const record_scope &) = delete;
26 record_scope &operator=(record_scope &&) = delete;
27
28private:
29 [[nodiscard]] record_scope(const void *Kernel, bool Enabled);
30 friend bool detail::scopeAllowsRecording(const void *Kernel) noexcept;
31
32 static thread_local record_scope *Top;
33 const void *Kernel;
34 bool Enabled;
35 record_scope *Previous;
36};
37
38} // namespace mneme
record_scope(Return(*Kernel)(Args...), bool Enabled)
Definition MnemeRecordScope.hpp:18
friend bool detail::scopeAllowsRecording(const void *Kernel) noexcept
record_scope(T *)=delete
record_scope(bool Enabled) noexcept
Definition MnemeRecordScope.cpp:10
~record_scope() noexcept
Definition MnemeRecordScope.cpp:23
Definition MnemeAnnotation.cpp:13
bool scopeAllowsRecording(const void *Kernel) noexcept
Definition MnemeRecordScope.cpp:28
Definition MnemeAnnotation.cpp:3