From 15be51385e2d3707f95505d51621136c562793cf Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Fri, 29 Jun 2018 13:02:23 +0800 Subject: [PATCH] fix Mac compile errors --- .../analysis/tensorrt_subgraph_node_mark_pass.h | 13 ++++++++++--- .../inference/analysis/tensorrt_subgraph_pass.h | 9 +++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/inference/analysis/tensorrt_subgraph_node_mark_pass.h b/paddle/fluid/inference/analysis/tensorrt_subgraph_node_mark_pass.h index 6cfac55d3..c558a6ebb 100644 --- a/paddle/fluid/inference/analysis/tensorrt_subgraph_node_mark_pass.h +++ b/paddle/fluid/inference/analysis/tensorrt_subgraph_node_mark_pass.h @@ -16,6 +16,10 @@ * This file defines TensorRTSubgraphNodeMarkPass which helps to mark the ops * that supported by TensorRT engine. */ + +#pragma once + +#include #include "paddle/fluid/inference/analysis/pass.h" #include "paddle/fluid/inference/analysis/subgraph_splitter.h" @@ -30,7 +34,8 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass { public: using teller_t = SubGraphSplitter::NodeInsideSubgraphTeller; - TensorRTSubgraphNodeMarkPass(const teller_t& teller) : teller_(teller) {} + explicit TensorRTSubgraphNodeMarkPass(const teller_t& teller) + : teller_(teller) {} bool Initialize(Argument* argument) override { return true; } @@ -38,8 +43,10 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass { // sub-graph into TensorRT. void Run(DataFlowGraph* graph) override; - std::string repr() const { return "tensorrt-sub-subgraph-mark"; } - std::string description() const { return "tensorrt sub-graph mark pass"; } + std::string repr() const override { return "tensorrt-sub-subgraph-mark"; } + std::string description() const override { + return "tensorrt sub-graph mark pass"; + } Pass* CreateGraphvizDebugerPass() const override; bool Finalize() override; diff --git a/paddle/fluid/inference/analysis/tensorrt_subgraph_pass.h b/paddle/fluid/inference/analysis/tensorrt_subgraph_pass.h index 11e088069..c6741a920 100644 --- a/paddle/fluid/inference/analysis/tensorrt_subgraph_pass.h +++ b/paddle/fluid/inference/analysis/tensorrt_subgraph_pass.h @@ -14,6 +14,7 @@ limitations under the License. */ #pragma once +#include #include "paddle/fluid/inference/analysis/node.h" #include "paddle/fluid/inference/analysis/pass.h" #include "paddle/fluid/inference/analysis/subgraph_splitter.h" @@ -30,7 +31,7 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { // Tell whether to transform a sub-graph into TensorRT. using NodeInsideSubgraphTeller = SubGraphFuse::NodeInsideSubgraphTeller; - TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller); + explicit TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller); bool Initialize(Argument* argument) override { return true; } @@ -40,8 +41,8 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { bool Finalize() override { return true; } - std::string repr() const { return "tensorrt-sub-graph"; } - std::string description() const { return "tensorrt sub graph pass"; } + std::string repr() const override { return "tensorrt-sub-graph"; } + std::string description() const override { return "tensorrt sub graph pass"; } private: NodeInsideSubgraphTeller node_inside_subgraph_teller_; @@ -49,4 +50,4 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { } // namespace analysis } // namespace inference -} // paddle +} // namespace paddle -- GitLab