diff options
5 files changed, 11 insertions, 34 deletions
diff --git a/tensorflow/compiler/xla/BUILD b/tensorflow/compiler/xla/BUILD index 38e39afdc0..c22fd37129 100644 --- a/tensorflow/compiler/xla/BUILD +++ b/tensorflow/compiler/xla/BUILD @@ -444,10 +444,6 @@ cc_library( srcs = ["executable_run_options.cc"], hdrs = ["executable_run_options.h"], visibility = ["//visibility:public"], - deps = [ - ":types", - "//tensorflow/core:lib", - ], ) cc_library( diff --git a/tensorflow/compiler/xla/executable_run_options.cc b/tensorflow/compiler/xla/executable_run_options.cc index f8bb8e52c7..392ad9010a 100644 --- a/tensorflow/compiler/xla/executable_run_options.cc +++ b/tensorflow/compiler/xla/executable_run_options.cc @@ -15,8 +15,6 @@ limitations under the License. #include "tensorflow/compiler/xla/executable_run_options.h" -#include "tensorflow/core/lib/strings/stringprintf.h" - namespace xla { ExecutableRunOptions& ExecutableRunOptions::set_device_ordinal( @@ -89,19 +87,4 @@ const DeviceAssignment* ExecutableRunOptions::device_assignment() const { return device_assignment_; } -string ExecutableRunOptions::ToString() const { - return tensorflow::strings::Printf( - "ExecutableRunOptions{allocator=%p, device_ordinal=%d, " - "device_assignment=%p, stream=%p, inter_op_thread_pool=%p, " - "intra_op_thread_pool=%p, execution_profile=%p}", - allocator_, device_ordinal_, device_assignment_, stream_, - inter_op_thread_pool_, intra_op_thread_pool_, execution_profile_); -} - -std::ostream& operator<<(std::ostream& out, - const ExecutableRunOptions& options) { - out << options.ToString(); - return out; -} - } // namespace xla diff --git a/tensorflow/compiler/xla/executable_run_options.h b/tensorflow/compiler/xla/executable_run_options.h index c7a20bb33c..d4fcbf0493 100644 --- a/tensorflow/compiler/xla/executable_run_options.h +++ b/tensorflow/compiler/xla/executable_run_options.h @@ -16,8 +16,6 @@ limitations under the License. #ifndef TENSORFLOW_COMPILER_XLA_EXECUTABLE_RUN_OPTIONS_H_ #define TENSORFLOW_COMPILER_XLA_EXECUTABLE_RUN_OPTIONS_H_ -#include "tensorflow/compiler/xla/types.h" - // Intentionally forward declared so that ExecutableRunOptions can be linked // into an XLA-compiled binary without having to link all of the pointed-to // objects (e.g., for an ahead-of-time compiled CPU binary, the gpu tools don't @@ -86,8 +84,6 @@ class ExecutableRunOptions { DeviceAssignment* device_assignment); const DeviceAssignment* device_assignment() const; - string ToString() const; - private: DeviceMemoryAllocator* allocator_ = nullptr; int device_ordinal_ = -1; @@ -98,9 +94,6 @@ class ExecutableRunOptions { ExecutionProfile* execution_profile_ = nullptr; }; -std::ostream& operator<<(std::ostream& out, - const ExecutableRunOptions& options); - } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_EXECUTABLE_RUN_OPTIONS_H_ diff --git a/tensorflow/compiler/xla/tools/dumped_computation_to_operation_list.cc b/tensorflow/compiler/xla/tools/dumped_computation_to_operation_list.cc index 4ad356d045..b82f1c81c8 100644 --- a/tensorflow/compiler/xla/tools/dumped_computation_to_operation_list.cc +++ b/tensorflow/compiler/xla/tools/dumped_computation_to_operation_list.cc @@ -85,10 +85,12 @@ void RealMain(tensorflow::gtl::ArraySlice<char*> args) { for (int i = 0; i < program_shape->parameters_size(); ++i) { layouts.push_back(&program_shape->parameters(i)); } + ExecutableBuildOptions build_options; + build_options.set_device_ordinal(0); + build_options.set_result_layout(program_shape->result()); StatusOr<std::unique_ptr<Executable>> executable = - local_service->CompileExecutable( - computation.handle(), layouts, &program_shape->result(), - /*device_ordinal=*/0, /*device_allocator=*/nullptr); + local_service->CompileExecutable(computation.handle(), layouts, + build_options); const HloModule& module = executable.ValueOrDie()->module(); diff --git a/tensorflow/compiler/xla/tools/dumped_computation_to_text.cc b/tensorflow/compiler/xla/tools/dumped_computation_to_text.cc index 5ebb75a31c..05c0fdf97d 100644 --- a/tensorflow/compiler/xla/tools/dumped_computation_to_text.cc +++ b/tensorflow/compiler/xla/tools/dumped_computation_to_text.cc @@ -60,10 +60,13 @@ void RealMain(tensorflow::gtl::ArraySlice<char*> args, bool compile) { for (int i = 0; i < program_shape->parameters_size(); ++i) { layouts.push_back(&program_shape->parameters(i)); } + + ExecutableBuildOptions build_options; + build_options.set_device_ordinal(0); + build_options.set_result_layout(program_shape->result()); StatusOr<std::unique_ptr<Executable>> executable = - local_service->CompileExecutable( - computation.handle(), layouts, &program_shape->result(), - /*device_ordinal=*/0, /*device_allocator=*/nullptr); + local_service->CompileExecutable(computation.handle(), layouts, + build_options); const HloModule& module = executable.ValueOrDie()->module(); |