| 172 | } |
| 173 | |
| 174 | void EagerEvalManager::prepare_for_exec(OperatorNodeBase* opr) { |
| 175 | // validate inputs |
| 176 | opr->add_input_layout_constraint(); |
| 177 | for (auto&& i : opr->node_prop().dep_map()) { |
| 178 | using NodeProp = OperatorNodeBase::NodeProp; |
| 179 | bool is_empty = !i.first->shape().ndim; |
| 180 | if (NodeProp::is_device_value_dep(i.second)) { |
| 181 | mgb_assert( |
| 182 | i.first->dev_tensor_valid(), |
| 183 | "var value not valid, but required for opr input: " |
| 184 | "var=%s reader=%s{%s}", |
| 185 | cg::dump_var_info({i.first}).c_str(), opr->cname(), |
| 186 | opr->dyn_typeinfo()->name); |
| 187 | if (i.first->dev_tensor().empty()) { |
| 188 | is_empty = true; |
| 189 | } else { |
| 190 | ensure_input_layout(i.first); |
| 191 | } |
| 192 | } |
| 193 | if (is_empty) { |
| 194 | mgb_assert( |
| 195 | i.second & NodeProp::DepType::VALUE_ALLOW_EMPTY, |
| 196 | "var value is empty but the reader opr does not allow " |
| 197 | "this: var=%s reader=%s{%s}", |
| 198 | cg::dump_var_info({i.first}).c_str(), opr->cname(), |
| 199 | opr->dyn_typeinfo()->name); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | // add input ready events |
| 204 | for (auto&& i : opr->input_waiting_spec()) { |
| 205 | for (auto j : i.dev_ready) { |
| 206 | auto mgr = VarNodeMemManager::var_node_cn_sync_manager(j); |
| 207 | if (!mgr->m_ready_event) { |
| 208 | mgr->m_ready_event = mgr->m_comp_node.create_event(); |
| 209 | mgr->m_ready_event->record(); |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | void EagerEvalManager::update_static_infer_result(OperatorNodeBase* opr) { |
| 216 | auto&& mgr = |
nothing calls this directly
no test coverage detected