| 615 | |
| 616 | template <typename T, typename U> |
| 617 | std::shared_ptr<T> getExecutor(long graph_id, |
| 618 | const std::unordered_map<long, std::shared_ptr<U>>& executors) |
| 619 | { |
| 620 | assert(hasKey(executors, graph_id)); |
| 621 | if (auto executor = std::dynamic_pointer_cast<T>(executors.at(graph_id))) { return executor; } |
| 622 | throw std::runtime_error("Invalid executor type"); |
| 623 | } |
| 624 | |
| 625 | extern std::shared_ptr<DSParamRegistry> param_registry; |
| 626 | extern std::unordered_map<long, std::shared_ptr<CustomOpExecutor>> executors; |