提交 15be5138 编写于 作者: F fengjiayi

fix Mac compile errors

上级 02e521e3
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
* This file defines TensorRTSubgraphNodeMarkPass which helps to mark the ops * This file defines TensorRTSubgraphNodeMarkPass which helps to mark the ops
* that supported by TensorRT engine. * that supported by TensorRT engine.
*/ */
#pragma once
#include <string>
#include "paddle/fluid/inference/analysis/pass.h" #include "paddle/fluid/inference/analysis/pass.h"
#include "paddle/fluid/inference/analysis/subgraph_splitter.h" #include "paddle/fluid/inference/analysis/subgraph_splitter.h"
...@@ -30,7 +34,8 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass { ...@@ -30,7 +34,8 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass {
public: public:
using teller_t = SubGraphSplitter::NodeInsideSubgraphTeller; 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; } bool Initialize(Argument* argument) override { return true; }
...@@ -38,8 +43,10 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass { ...@@ -38,8 +43,10 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass {
// sub-graph into TensorRT. // sub-graph into TensorRT.
void Run(DataFlowGraph* graph) override; void Run(DataFlowGraph* graph) override;
std::string repr() const { return "tensorrt-sub-subgraph-mark"; } std::string repr() const override { return "tensorrt-sub-subgraph-mark"; }
std::string description() const { return "tensorrt sub-graph mark pass"; } std::string description() const override {
return "tensorrt sub-graph mark pass";
}
Pass* CreateGraphvizDebugerPass() const override; Pass* CreateGraphvizDebugerPass() const override;
bool Finalize() override; bool Finalize() override;
......
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once #pragma once
#include <string>
#include "paddle/fluid/inference/analysis/node.h" #include "paddle/fluid/inference/analysis/node.h"
#include "paddle/fluid/inference/analysis/pass.h" #include "paddle/fluid/inference/analysis/pass.h"
#include "paddle/fluid/inference/analysis/subgraph_splitter.h" #include "paddle/fluid/inference/analysis/subgraph_splitter.h"
...@@ -30,7 +31,7 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { ...@@ -30,7 +31,7 @@ class TensorRTSubGraphPass : public DataFlowGraphPass {
// Tell whether to transform a sub-graph into TensorRT. // Tell whether to transform a sub-graph into TensorRT.
using NodeInsideSubgraphTeller = SubGraphFuse::NodeInsideSubgraphTeller; using NodeInsideSubgraphTeller = SubGraphFuse::NodeInsideSubgraphTeller;
TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller); explicit TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller);
bool Initialize(Argument* argument) override { return true; } bool Initialize(Argument* argument) override { return true; }
...@@ -40,8 +41,8 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { ...@@ -40,8 +41,8 @@ class TensorRTSubGraphPass : public DataFlowGraphPass {
bool Finalize() override { return true; } bool Finalize() override { return true; }
std::string repr() const { return "tensorrt-sub-graph"; } std::string repr() const override { return "tensorrt-sub-graph"; }
std::string description() const { return "tensorrt sub graph pass"; } std::string description() const override { return "tensorrt sub graph pass"; }
private: private:
NodeInsideSubgraphTeller node_inside_subgraph_teller_; NodeInsideSubgraphTeller node_inside_subgraph_teller_;
...@@ -49,4 +50,4 @@ class TensorRTSubGraphPass : public DataFlowGraphPass { ...@@ -49,4 +50,4 @@ class TensorRTSubGraphPass : public DataFlowGraphPass {
} // namespace analysis } // namespace analysis
} // namespace inference } // namespace inference
} // paddle } // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册