| 204 | |
| 205 | |
| 206 | PointViewSet Stage::execute(PointTableRef table) |
| 207 | { |
| 208 | if (!table.layout()->finalized()) |
| 209 | { |
| 210 | for (const auto& id : table.layout()->dims()) |
| 211 | { |
| 212 | if (Dimension::isDeprecated(id)) |
| 213 | { |
| 214 | log()->get(LogLevel::Warning) << |
| 215 | "Dimension " << Dimension::name(id) << " is deprecated" << |
| 216 | std::endl; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | table.finalize(); |
| 222 | |
| 223 | // We store stage instances instead of stages because a stage may get |
| 224 | // executed more than once. A stage instance is created for each |
| 225 | // execution of a stage in a pipeline. This properly builds out |
| 226 | // diamond-shaped pipelines. |
| 227 | int stageInstanceId = 1; |
| 228 | struct StageInstance |
| 229 | { |
| 230 | Stage *m_stage; |
| 231 | int m_id; |
| 232 | |
| 233 | StageInstance(Stage *s, int id) : m_stage(s), m_id(id) |
| 234 | {} |
| 235 | StageInstance() : m_stage(nullptr), m_id(0) |
| 236 | {} |
| 237 | |
| 238 | bool operator<(const StageInstance& other) const |
| 239 | { return m_id < other.m_id; } |
| 240 | }; |
| 241 | |
| 242 | std::stack<StageInstance> stages; |
| 243 | std::stack<StageInstance> pending; |
| 244 | std::map<StageInstance, StageInstance> children; |
| 245 | |
| 246 | m_log->get(LogLevel::Debug) << "Executing pipeline in standard mode." << |
| 247 | std::endl; |
| 248 | |
| 249 | pending.push(StageInstance(this, stageInstanceId++)); |
| 250 | |
| 251 | // Linearize stage execution. |
| 252 | while (pending.size()) |
| 253 | { |
| 254 | StageInstance si = pending.top(); |
| 255 | pending.pop(); |
| 256 | stages.push(si); |
| 257 | for (Stage *in : si.m_stage->m_inputs) |
| 258 | { |
| 259 | StageInstance parent(in, stageInstanceId++); |
| 260 | pending.push(parent); |
| 261 | children[parent] = si; |
| 262 | } |
| 263 | } |
nothing calls this directly
no test coverage detected