| 146 | }; |
| 147 | |
| 148 | OpTask::OpTaskOutputs OpTask::Run() { |
| 149 | InitMeta(); |
| 150 | |
| 151 | // We cannot use DomainTimeRange, because it would outlive workspace_scope - we can use `optional` |
| 152 | // to shorten the life of the range. |
| 153 | std::optional<DomainTimeRange> ws_init_tr; |
| 154 | ws_init_tr.emplace(meta_->nvtx.init_ws_range_name); |
| 155 | auto workspace_scope = GetWorkspace(); |
| 156 | |
| 157 | // SetWorkspaceInputs must not go into the try/catch because it rethrows errors |
| 158 | // from the inputs and we don't want them to be wrapped again as this operator's error. |
| 159 | SetWorkspaceInputs(); |
| 160 | |
| 161 | ws_init_tr.reset(); // the range ends here |
| 162 | |
| 163 | try { |
| 164 | SetupOp(); |
| 165 | RunOp(); |
| 166 | auto &&ret = GetWorkspaceOutputs(); |
| 167 | return ret; |
| 168 | } catch (...) { |
| 169 | PropagateError({ |
| 170 | std::current_exception(), |
| 171 | "Critical error in pipeline:\n" + GetErrorContextMessage(node_->op->GetSpec()), |
| 172 | "\nCurrent pipeline object is no longer valid."}); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | bool OpTask::ShouldSkip() const { |
| 177 | int ninp_reg = ws_->NumInput(); |
no test coverage detected