Skip to content

Commit e8e1249

Browse files
authored
fix multi-thread error of fc_gru_fuse_pass.cc, test=develop (#21841) (#22185)
* fix multi-thread error of fc_gru_fuse_pass.cc, test=develop * export FLAGS and GLOG symbols, test=develop
1 parent 91706d3 commit e8e1249

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

paddle/fluid/framework/ir/fc_gru_fuse_pass.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ static int BuildFusion(Graph* graph, const std::string& name_scope,
9292
}
9393
#undef GET_NODE
9494

95-
#define NEW_IMTERMEDIATE_OUT(key) \
96-
scope.Var(NEW_NAME(key))->GetMutable<framework::LoDTensor>()
95+
#define NEW_IMTERMEDIATE_OUT(key) \
96+
VarDesc key(NEW_NAME(key)); \
97+
key.SetPersistable(false); \
98+
auto* key##_node = graph->CreateVarNode(&key); \
99+
IR_NODE_LINK_TO(op, key##_node);
100+
97101
NEW_IMTERMEDIATE_OUT(ReorderedH0);
98102
NEW_IMTERMEDIATE_OUT(XX);
99103
NEW_IMTERMEDIATE_OUT(BatchedInput);

paddle/fluid/inference/api/demo_ci/vis_demo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DEFINE_string(
3131
"'<space splitted floats as data>\t<space splitted ints as shape'");
3232
DEFINE_bool(use_gpu, false, "Whether use gpu.");
3333
#ifdef PADDLE_WITH_SHARED_LIB
34-
DEFINE_bool(profile, false, "Whether use profile.");
34+
DECLARE_bool(profile);
3535
#endif
3636

3737
namespace paddle {

paddle/fluid/inference/paddle_fluid.map

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
global:
33
*paddle*;
44
*Pass*;
5-
*profile*;
5+
extern "C++" {
6+
fL*::*;
7+
};
68
local:
79
*;
810
};
11+

0 commit comments

Comments
 (0)