diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-01-24 15:35:34 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-24 15:44:08 -0800 |
commit | f9006d72eb8541e7ca898de39747f26c4d5995f6 (patch) | |
tree | 25b093426c85799244986557fc7fe7fa7ff1eff5 /tensorflow/compiler/xla/service/hlo_pass_pipeline.h | |
parent | cdcc0f58a27b9f791f3c7396592142ad04ee4a57 (diff) |
[XLA] Make `HloPass` an interface, NFC
This will allow inheritance from both `HloPassInterface` and `DfsHloVisitor`, so various passes which include a visitor can have handler methods overridden per backend.
Change: 145477041
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_pass_pipeline.h')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_pass_pipeline.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_pass_pipeline.h b/tensorflow/compiler/xla/service/hlo_pass_pipeline.h index f49eed8cba..7a9c606a48 100644 --- a/tensorflow/compiler/xla/service/hlo_pass_pipeline.h +++ b/tensorflow/compiler/xla/service/hlo_pass_pipeline.h @@ -24,7 +24,7 @@ limitations under the License. #include "tensorflow/compiler/xla/ptr_util.h" #include "tensorflow/compiler/xla/service/compiler.h" #include "tensorflow/compiler/xla/service/hlo_module.h" -#include "tensorflow/compiler/xla/service/hlo_pass.h" +#include "tensorflow/compiler/xla/service/hlo_pass_interface.h" #include "tensorflow/compiler/xla/statusor.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/core/platform/macros.h" @@ -32,11 +32,12 @@ limitations under the License. namespace xla { // Pipeline of HLO passes. -class HloPassPipeline : public HloPass { +class HloPassPipeline : public HloPassInterface { public: explicit HloPassPipeline(const string& name, const Compiler::HloDumper& dumper) - : HloPass(name), dumper_(dumper) {} + : name_(name), dumper_(dumper) {} + tensorflow::StringPiece name() const override { return name_; } // Add a pass to the pipeline. It should be called with the arguments for the // pass constructor: @@ -55,8 +56,9 @@ class HloPassPipeline : public HloPass { StatusOr<bool> Run(HloModule* module) override; private: + const string name_; Compiler::HloDumper dumper_; - std::vector<std::unique_ptr<HloPass>> passes_; + std::vector<std::unique_ptr<HloPassInterface>> passes_; TF_DISALLOW_COPY_AND_ASSIGN(HloPassPipeline); }; |