| 383 | } |
| 384 | |
| 385 | int HexagonOpsDefinitions::GetOpIdFor(const string& op_type, |
| 386 | const DataTypeVector& dt_vec) const { |
| 387 | if (op_name_to_soc_op_type_map_.count(op_type) > 0) { |
| 388 | const std::vector<DataTypeToOp>& dt_to_op_vec = |
| 389 | op_name_to_soc_op_type_map_.at(op_type); |
| 390 | CHECK(!dt_to_op_vec.empty()); |
| 391 | // If argument DataType is empty, return the first entry. |
| 392 | if (dt_vec.empty()) { |
| 393 | return static_cast<int>(std::get<1>(dt_to_op_vec.front())); |
| 394 | } |
| 395 | // If there is only one op_id registered for empty op_vec, we assume |
| 396 | // that the op supports any data types. |
| 397 | if (dt_to_op_vec.size() == 1 && std::get<0>(dt_to_op_vec.front()).empty()) { |
| 398 | return static_cast<int>(std::get<1>(dt_to_op_vec.front())); |
| 399 | } |
| 400 | for (const DataTypeToOp& data_type_to_op : dt_to_op_vec) { |
| 401 | if (std::get<0>(data_type_to_op) == dt_vec) { |
| 402 | return static_cast<int>(std::get<1>(data_type_to_op)); |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | return IRemoteFusedGraphOpsDefinitions::INVALID_OP_ID; |
| 407 | } |
| 408 | } // namespace tensorflow |
no test coverage detected