muda
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>
5 namespace muda
6 {
7 class 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 
28 template <>
30 {
31  using type = GraphViewer;
32 };
33 
34 template <>
36 {
37  using type = GraphViewer;
38 };
39 
40 static_assert(is_uniform_viewer_v<GraphViewer>);
41 } // namespace muda
42 
43 #include "details/graph_viewer.inl"
Definition: type_modifier.h:21
Definition: type_modifier.h:27
Definition: graph_viewer.h:7
Definition: assert.h:13
Definition: viewer_base.h:21
Definition: compute_graph.h:37