diff options
author | 2018-02-26 14:32:08 -0800 | |
---|---|---|
committer | 2018-02-26 14:40:15 -0800 | |
commit | a80896d3b3a2358f324dc4cd429409ea9acc8a09 (patch) | |
tree | 044bdf179baf81dcd2caaa37bd096035d35ba084 /tensorflow | |
parent | 26a765f95acc7cbc762b8e1fef94921cab8f181d (diff) |
Track DebugOptions in AotCompilationOptions
In particular, I need this for supporting HLO profiling in the AOT backend.
PiperOrigin-RevId: 187081674
Diffstat (limited to 'tensorflow')
-rw-r--r-- | tensorflow/compiler/xla/service/compile_only_service.cc | 3 | ||||
-rw-r--r-- | tensorflow/compiler/xla/service/compiler.cc | 3 | ||||
-rw-r--r-- | tensorflow/compiler/xla/service/compiler.h | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/compile_only_service.cc b/tensorflow/compiler/xla/service/compile_only_service.cc index dab73596e1..6664496ab6 100644 --- a/tensorflow/compiler/xla/service/compile_only_service.cc +++ b/tensorflow/compiler/xla/service/compile_only_service.cc @@ -72,8 +72,7 @@ CompileOnlyService::CompileAheadOfTime( VersionedComputationHandle versioned_handle = user_computation->GetVersionedHandle(); - // TODO(b/63773457): Track DebugOptions in AotCompilationOptions. - DebugOptions debug_options = legacy_flags::GetDebugOptionsFromFlags(); + const DebugOptions& debug_options = options.debug_options(); // Dump computation proto state if flag is set. const string& directory_path = debug_options.xla_dump_computations_to(); diff --git a/tensorflow/compiler/xla/service/compiler.cc b/tensorflow/compiler/xla/service/compiler.cc index e2e9d2a0c0..0392d4af48 100644 --- a/tensorflow/compiler/xla/service/compiler.cc +++ b/tensorflow/compiler/xla/service/compiler.cc @@ -86,4 +86,7 @@ Compiler::GetPlatformCompilers() { return compilers->at(platform->id()).get(); } +AotCompilationOptions::AotCompilationOptions() + : debug_options_(legacy_flags::GetDebugOptionsFromFlags()) {} + } // namespace xla diff --git a/tensorflow/compiler/xla/service/compiler.h b/tensorflow/compiler/xla/service/compiler.h index 74fd24edf8..33e19efc72 100644 --- a/tensorflow/compiler/xla/service/compiler.h +++ b/tensorflow/compiler/xla/service/compiler.h @@ -79,11 +79,15 @@ class AotCompilationOptions { device_allocator_ = device_allocator; } + const DebugOptions& debug_options() const { return debug_options_; } + DebugOptions* mutable_debug_options() { return &debug_options_; } + protected: - AotCompilationOptions() = default; + AotCompilationOptions(); private: DeviceMemoryAllocator* device_allocator_ = nullptr; + DebugOptions debug_options_; }; // Abstract compiler interface that is subclassed for compilation on a |