未验证 提交 b99986a3 编写于 作者: H hong19860320 提交者: GitHub

[Core] Fix stack overflow in STL::ostream (#3503)

上级 92e1142d
...@@ -161,6 +161,7 @@ std::set<TargetType> ExpandValidTargets(TargetType target) { ...@@ -161,6 +161,7 @@ std::set<TargetType> ExpandValidTargets(TargetType target) {
TARGET(kBM), TARGET(kBM),
TARGET(kMLU), TARGET(kMLU),
TARGET(kAPU), TARGET(kAPU),
TARGET(kRKNPU),
TARGET(kFPGA)}); TARGET(kFPGA)});
if (target == TARGET(kAny)) { if (target == TARGET(kAny)) {
return valid_set; return valid_set;
......
...@@ -260,6 +260,9 @@ class KernelRegistry final { ...@@ -260,6 +260,9 @@ class KernelRegistry final {
KernelRegistryForTarget<TARGET(kRKNPU), KernelRegistryForTarget<TARGET(kRKNPU),
PRECISION(kAny), PRECISION(kAny),
DATALAYOUT(kAny)> *, // DATALAYOUT(kAny)> *, //
KernelRegistryForTarget<TARGET(kRKNPU),
PRECISION(kAny),
DATALAYOUT(kNCHW)> *, //
KernelRegistryForTarget<TARGET(kRKNPU), KernelRegistryForTarget<TARGET(kRKNPU),
PRECISION(kFloat), PRECISION(kFloat),
DATALAYOUT(kNCHW)> *, // DATALAYOUT(kNCHW)> *, //
......
...@@ -41,7 +41,7 @@ void ostream::pad(const std::string& text) { ...@@ -41,7 +41,7 @@ void ostream::pad(const std::string& text) {
#define ADD_DATA_AS_STRING(data_, obj_) #define ADD_DATA_AS_STRING(data_, obj_)
#else #else
#define ADD_DATA_AS_STRING(data_, obj_) \ #define ADD_DATA_AS_STRING(data_, obj_) \
std::string text = paddle::lite::to_string(obj_); \ std::string text = std::to_string(obj_); \
pad(text); \ pad(text); \
data_ = data_ + text; data_ = data_ + text;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册