| 205 | bool TaskNode::IsMeaningLess() { return produced_regsts_.empty() && consumed_regsts_.empty(); } |
| 206 | |
| 207 | void TaskNode::InitFromProtoExceptConsumedRegsts(const TaskProto& task_proto) { |
| 208 | // Step1: init some scalar items. |
| 209 | CHECK(task_proto.task_type() == GetTaskType()); |
| 210 | machine_id_ = task_proto.machine_id(); |
| 211 | thrd_id_ = task_proto.thrd_id(); |
| 212 | task_id_ = task_proto.task_id(); |
| 213 | new_task_id_.reset(new TaskId(DecodeTaskIdFromInt64(task_id_))); |
| 214 | CHECK(task_proto.job_id() == GlobalJobDesc().job_id()); |
| 215 | chain_id_ = task_proto.chain_id(); |
| 216 | order_in_chain_ = task_proto.order_in_chain(); |
| 217 | // Step2: check exec_gph empty. |
| 218 | CHECK(task_proto.exec_sequence().exec_node().empty()); |
| 219 | // Step3: init produced_regst. |
| 220 | for (const auto& pair : task_proto.produced_regst_desc()) { |
| 221 | const auto& regst_desc = ProduceRegst(pair.first, pair.second.enable_reuse_mem()); |
| 222 | // regst_desc->consumers_ will be initialized by RegstDesc::InitConsumersFromProto. |
| 223 | regst_desc->InitFromProtoExceptConsumers(pair.second); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | Maybe<void> TaskNode::InitConsumedRegstsFromProto( |
| 228 | const TaskProto& task_proto, |
no test coverage detected