| 325 | } |
| 326 | |
| 327 | bool NodeOpsRegistryManager::RegisterOPImplementor(const std::string& registry_name, const std::string& op_name, |
| 328 | select_node_ops_t select_func, int priority) |
| 329 | { |
| 330 | // TODO: Add Lock to protect find and register registry |
| 331 | |
| 332 | auto registry = FindRegistry(registry_name); |
| 333 | |
| 334 | if(registry == nullptr) |
| 335 | { |
| 336 | registry = new NodeOpsRegistry(registry_name); |
| 337 | NodeOpsRegistryManager::AddRegistry(registry->reg_name, registry); |
| 338 | } |
| 339 | |
| 340 | PrioSelector* prio_selector = dynamic_cast<PrioSelector*>(registry->FindSelector(op_name)); |
| 341 | |
| 342 | if(prio_selector == nullptr) |
| 343 | { |
| 344 | prio_selector = new PrioSelector(); |
| 345 | prio_selector->op_name = op_name; |
| 346 | |
| 347 | registry->RegisterSelector(prio_selector); |
| 348 | } |
| 349 | |
| 350 | if(!prio_selector->Register(priority, select_func)) |
| 351 | return false; |
| 352 | |
| 353 | return true; |
| 354 | } |
| 355 | |
| 356 | NodeOps* NodeOpsRegistry::FindNodeOps(const CPUInfo* cpu_info, Node* node) |
| 357 | { |
nothing calls this directly
no test coverage detected