| 251 | } |
| 252 | |
| 253 | NodeOps* NodeOpsRegistryManager::RealFindNodeOps(const CPUInfo* cpu_info, Node* node) |
| 254 | { |
| 255 | NodeOps* ops; |
| 256 | |
| 257 | if(cpu_info != nullptr) |
| 258 | { |
| 259 | // search cpu_type |
| 260 | int master_cpu = cpu_info->GetMasterCPU(); |
| 261 | |
| 262 | const std::string& cpu_model = cpu_info->GetCPUModelString(master_cpu); |
| 263 | |
| 264 | ops = FindNodeOps(cpu_model, cpu_info, node); |
| 265 | |
| 266 | if(ops) |
| 267 | return ops; |
| 268 | |
| 269 | // search arch |
| 270 | std::string cpu_arch; |
| 271 | |
| 272 | int int_arch = cpu_info->GetCPUArch(master_cpu); |
| 273 | |
| 274 | if(int_arch == ARCH_ARM_V8) |
| 275 | { |
| 276 | cpu_arch = "arm64"; |
| 277 | } |
| 278 | else if(int_arch == ARCH_ARM_V7) |
| 279 | { |
| 280 | cpu_arch = "arm32"; |
| 281 | } |
| 282 | |
| 283 | ops = FindNodeOps(cpu_arch, cpu_info, node); |
| 284 | |
| 285 | if(ops) |
| 286 | return ops; |
| 287 | } |
| 288 | |
| 289 | // search common |
| 290 | |
| 291 | ops = FindNodeOps("common", cpu_info, node); |
| 292 | |
| 293 | if(ops) |
| 294 | return ops; |
| 295 | |
| 296 | // the final search: reference |
| 297 | |
| 298 | ops = FindNodeOps(REF_REGISTRY_NAME, cpu_info, node); |
| 299 | |
| 300 | return ops; |
| 301 | } |
| 302 | |
| 303 | void NodeOpsRegistryManager::AddRegistry(const std::string& name, NodeOpsRegistry* reg) |
| 304 | { |
nothing calls this directly
no test coverage detected