MUDA
Loading...
Searching...
No Matches
graph_viewer.h
1#pragma once
2#include <cuda.h>
3#include <muda/viewer/viewer_base.h>
4#include <muda/graph/graph_instantiate_flag.h>
5namespace muda
6{
7class GraphViewer : public ViewerBase<true>
8{
9 MUDA_VIEWER_COMMON_NAME(GraphViewer);
10
11 public:
12 MUDA_GENERIC GraphViewer() = default;
13 MUDA_GENERIC GraphViewer(cudaGraphExec_t graph, Flags<GraphInstantiateFlagBit> flags);
14
15 MUDA_GENERIC void launch(cudaStream_t stream = nullptr) const;
16
17 MUDA_DEVICE void tail_launch() const;
18 MUDA_DEVICE void fire_and_forget() const;
19
20 MUDA_GENERIC auto handle() const { return m_graph; }
21
22 private:
23 friend class ComputeGraph;
24 cudaGraphExec_t m_graph = nullptr;
26};
27
28template <>
30{
31 using type = GraphViewer;
32};
33
34template <>
36{
37 using type = GraphViewer;
38};
39
40static_assert(is_uniform_viewer_v<GraphViewer>);
41} // namespace muda
42
43#include "details/graph_viewer.inl"
Definition compute_graph.h:38
Definition flag.h:9
Definition graph_viewer.h:8
Definition viewer_base.h:18
Definition type_modifier.h:22
Definition type_modifier.h:28