| 525 | } |
| 526 | |
| 527 | Status XlaCompiler::FindFunctionBody(const NameAttrList& function, |
| 528 | const FunctionBody** fbody) { |
| 529 | // The function may be in either the local_flib_runtime_ or flib_runtime_. |
| 530 | // Look up the function in local first and if it is not found then look up the |
| 531 | // function in flib_runtime_. |
| 532 | auto status = GetFunctionBody(function, local_flib_runtime_, fbody); |
| 533 | if (!status.ok()) { |
| 534 | if (!errors::IsNotFound(status)) { |
| 535 | return status; |
| 536 | } |
| 537 | TF_RETURN_WITH_CONTEXT_IF_ERROR( |
| 538 | GetFunctionBody(function, flib_runtime_, fbody), |
| 539 | "Local lookup failed with: ", status.error_message()); |
| 540 | VLOG(4) << "Function " << function.name() << " in flib_runtime_"; |
| 541 | } else { |
| 542 | VLOG(4) << "Function " << function.name() << " in local_flib_runtime_"; |
| 543 | } |
| 544 | return Status::OK(); |
| 545 | } |
| 546 | |
| 547 | std::unique_ptr<Graph> XlaCompiler::GetGraph(const FunctionBody* fbody) { |
| 548 | std::unique_ptr<Graph> graph(new Graph(options_.flib_def)); |
no test coverage detected