aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/compiler.h
diff options
context:
space:
mode:
authorGravatar Jacques Pienaar <jpienaar@google.com>2018-06-13 10:00:41 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-13 10:03:26 -0700
commit65cefda2f9a62f29af51b3effa0725c180244576 (patch)
treedd931fcbc392ac26f12725a45c01ca7f9507ed33 /tensorflow/compiler/xla/service/compiler.h
parentf0e053afc99c8dcf6aa196b00dafaee0a7f6923f (diff)
Add AotCompilationMetadata field to variant of CompileAheadOfTime.
Add CompileAheadOfTime parameter that can optionally be populated during compilation process. This change is to allow populating metadata even if the CompileAheadOfTime fails. PiperOrigin-RevId: 200407917
Diffstat (limited to 'tensorflow/compiler/xla/service/compiler.h')
-rw-r--r--tensorflow/compiler/xla/service/compiler.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/compiler.h b/tensorflow/compiler/xla/service/compiler.h
index 6c52ffd800..d1144f97bb 100644
--- a/tensorflow/compiler/xla/service/compiler.h
+++ b/tensorflow/compiler/xla/service/compiler.h
@@ -94,6 +94,19 @@ class AotCompilationOptions {
DebugOptions debug_options_;
};
+// Abstract superclass describing metadata produced during ahead-of-time
+// compilation.
+class AotCompilationMetadata {
+ public:
+ AotCompilationMetadata(const AotCompilationMetadata&) = delete;
+ AotCompilationMetadata& operator=(AotCompilationMetadata const&) = delete;
+
+ virtual ~AotCompilationMetadata() = default;
+
+ protected:
+ AotCompilationMetadata() = default;
+};
+
// Abstract compiler interface that is subclassed for compilation on a
// particular platform.
//
@@ -172,6 +185,13 @@ class Compiler {
CompileAheadOfTime(std::vector<std::unique_ptr<HloModule>> modules,
const AotCompilationOptions& options) = 0;
+ // Similar to CompileAheadOfTime above but AotCompilationMetadata
+ // has an argument that can be populated during compilation.
+ virtual StatusOr<std::vector<std::unique_ptr<AotCompilationResult>>>
+ CompileAheadOfTime(std::vector<std::unique_ptr<HloModule>> modules,
+ const AotCompilationOptions& options,
+ std::unique_ptr<AotCompilationMetadata>* metadata);
+
/////
// The Compiler class also serves as a point to register compiler objects
// for the various platforms.