| 338 | } |
| 339 | |
| 340 | StatusOr<std::vector<std::unique_ptr<LocalExecutable>>> LocalClient::Compile( |
| 341 | const XlaComputation& computation, |
| 342 | const absl::Span<const Shape* const> argument_layouts, |
| 343 | const ExecutableBuildOptions& options) { |
| 344 | ExecutableBuildOptions updated_options = options; |
| 345 | if (options.device_ordinal() == -1) { |
| 346 | updated_options.set_device_ordinal(default_device_ordinal()); |
| 347 | VLOG(3) << "Set device ordinal to default value of: " |
| 348 | << updated_options.device_ordinal(); |
| 349 | } |
| 350 | TF_ASSIGN_OR_RETURN(std::vector<std::unique_ptr<Executable>> executables, |
| 351 | local_service_->CompileExecutables( |
| 352 | computation, argument_layouts, updated_options)); |
| 353 | |
| 354 | std::vector<std::unique_ptr<LocalExecutable>> local_executables; |
| 355 | local_executables.reserve(executables.size()); |
| 356 | |
| 357 | for (auto& executable : executables) { |
| 358 | local_executables.push_back(absl::make_unique<LocalExecutable>( |
| 359 | std::move(executable), local_service_->mutable_backend(), |
| 360 | updated_options)); |
| 361 | } |
| 362 | |
| 363 | return std::move(local_executables); |
| 364 | } |
| 365 | |
| 366 | StatusOr<ScopedShapedBuffer> LocalClient::LiteralToShapedBuffer( |
| 367 | const LiteralSlice& literal, int device_ordinal, |
nothing calls this directly
no test coverage detected