18 std::string_view m_name;
24 std::string_view name()
const MUDA_NOEXCEPT {
return m_name; }
25 VarId var_id()
const MUDA_NOEXCEPT {
return m_var_id; }
26 bool is_valid()
const MUDA_NOEXCEPT {
return m_is_valid; }
31 virtual void graphviz_def(std::ostream& os,
36 template <
typename RWView>
37 RWView _eval(
const RWView& view);
38 template <
typename ROView>
39 ROView _ceval(ROView& view)
const;
45 std::string_view name,
46 VarId var_id) MUDA_NOEXCEPT : m_var_manager(var_manager),
54 std::string_view name,
56 bool is_valid) MUDA_NOEXCEPT : m_var_manager(var_manager),
70 mutable std::set<ClosureId> m_closure_ids;
73 void _building_eval(ComputeGraphVarUsage usage)
const;
74 void base_building_eval();
75 void base_building_ceval()
const;
78 class RelatedClosureInfo
82 std::set<ClosureId> closure_ids;
85 mutable std::map<ComputeGraph*, RelatedClosureInfo> m_related_closure_infos;
92 static_assert(!std::is_const_v<T>,
"T must not be const");
93 using ROViewer = read_only_viewer_t<T>;
95 static_assert(std::is_convertible_v<RWViewer, ROViewer>,
96 "RWViewer must be convertible to ROView");
102 using ComputeGraphVarBase::ComputeGraphVarBase;
110 std::string_view name,
112 const T& init_value) MUDA_NOEXCEPT
121 RWViewer eval() {
return _eval(m_value); }
122 ROViewer ceval()
const {
return _ceval(m_value); }
124 operator ROViewer()
const {
return ceval(); }
125 operator RWViewer() {
return eval(); }
127 void update(
const RWViewer& view);
129 virtual void graphviz_def(std::ostream& os,