Skip to content

Commit 15be513

Browse files
committed
fix Mac compile errors
1 parent 02e521e commit 15be513

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

paddle/fluid/inference/analysis/tensorrt_subgraph_node_mark_pass.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
* This file defines TensorRTSubgraphNodeMarkPass which helps to mark the ops
1717
* that supported by TensorRT engine.
1818
*/
19+
20+
#pragma once
21+
22+
#include <string>
1923
#include "paddle/fluid/inference/analysis/pass.h"
2024
#include "paddle/fluid/inference/analysis/subgraph_splitter.h"
2125

@@ -30,16 +34,19 @@ class TensorRTSubgraphNodeMarkPass : public DataFlowGraphPass {
3034
public:
3135
using teller_t = SubGraphSplitter::NodeInsideSubgraphTeller;
3236

33-
TensorRTSubgraphNodeMarkPass(const teller_t& teller) : teller_(teller) {}
37+
explicit TensorRTSubgraphNodeMarkPass(const teller_t& teller)
38+
: teller_(teller) {}
3439

3540
bool Initialize(Argument* argument) override { return true; }
3641

3742
// This class get a sub-graph as input and determine whether to transform this
3843
// sub-graph into TensorRT.
3944
void Run(DataFlowGraph* graph) override;
4045

41-
std::string repr() const { return "tensorrt-sub-subgraph-mark"; }
42-
std::string description() const { return "tensorrt sub-graph mark pass"; }
46+
std::string repr() const override { return "tensorrt-sub-subgraph-mark"; }
47+
std::string description() const override {
48+
return "tensorrt sub-graph mark pass";
49+
}
4350

4451
Pass* CreateGraphvizDebugerPass() const override;
4552
bool Finalize() override;

paddle/fluid/inference/analysis/tensorrt_subgraph_pass.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License. */
1414

1515
#pragma once
1616

17+
#include <string>
1718
#include "paddle/fluid/inference/analysis/node.h"
1819
#include "paddle/fluid/inference/analysis/pass.h"
1920
#include "paddle/fluid/inference/analysis/subgraph_splitter.h"
@@ -30,7 +31,7 @@ class TensorRTSubGraphPass : public DataFlowGraphPass {
3031
// Tell whether to transform a sub-graph into TensorRT.
3132
using NodeInsideSubgraphTeller = SubGraphFuse::NodeInsideSubgraphTeller;
3233

33-
TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller);
34+
explicit TensorRTSubGraphPass(const NodeInsideSubgraphTeller& teller);
3435

3536
bool Initialize(Argument* argument) override { return true; }
3637

@@ -40,13 +41,13 @@ class TensorRTSubGraphPass : public DataFlowGraphPass {
4041

4142
bool Finalize() override { return true; }
4243

43-
std::string repr() const { return "tensorrt-sub-graph"; }
44-
std::string description() const { return "tensorrt sub graph pass"; }
44+
std::string repr() const override { return "tensorrt-sub-graph"; }
45+
std::string description() const override { return "tensorrt sub graph pass"; }
4546

4647
private:
4748
NodeInsideSubgraphTeller node_inside_subgraph_teller_;
4849
};
4950

5051
} // namespace analysis
5152
} // namespace inference
52-
} // paddle
53+
} // namespace paddle

0 commit comments

Comments
 (0)