17 using S = std::shared_ptr<T>;
23 S<ComputeGraph> create_graph(std::string_view name =
"graph",
24 ComputeGraphFlag flags = {});
39 bool is_using()
const;
41 void sync_on(cudaStream_t stream)
const;
43 template <
typename... T>
45 template <
typename... T>
47 template <
typename... T>
50 bool is_using(
const span<const ComputeGraphVarBase*> vars)
const;
51 void sync(
const span<const ComputeGraphVarBase*> vars)
const;
52 void sync_on(cudaStream_t stream,
const span<const ComputeGraphVarBase*> vars)
const;
54 const auto& graphs()
const {
return m_graphs; }
61 std::vector<ComputeGraph*> unique_graphs(span<const ComputeGraphVarBase*> vars)
const;
62 std::unordered_map<std::string, ComputeGraphVarBase*> m_vars_map;
63 std::vector<ComputeGraphVarBase*> m_vars;
64 std::unordered_set<ComputeGraph*> m_graphs;
65 span<const ComputeGraphVarBase*> var_span()
const;