未验证 提交 ff57450d 编写于 作者: H huzhiqiang 提交者: GitHub

[Opt] Expand the `precisions\data_layout\targets` types supported by current opt (#3715)

上级 1f97cdeb
...@@ -92,6 +92,10 @@ std::vector<Place> ParserValidPlaces() { ...@@ -92,6 +92,10 @@ std::vector<Place> ParserValidPlaces() {
Place{TARGET(kARM), PRECISION(kFloat), DATALAYOUT(kNCHW)}); Place{TARGET(kARM), PRECISION(kFloat), DATALAYOUT(kNCHW)});
valid_places.emplace_back( valid_places.emplace_back(
Place{TARGET(kARM), PRECISION(kInt32), DATALAYOUT(kNCHW)}); Place{TARGET(kARM), PRECISION(kInt32), DATALAYOUT(kNCHW)});
valid_places.emplace_back(
Place{TARGET(kARM), PRECISION(kInt64), DATALAYOUT(kNCHW)});
valid_places.emplace_back(
Place{TARGET(kARM), PRECISION(kAny), DATALAYOUT(kNCHW)});
} else if (target_repr == "opencl") { } else if (target_repr == "opencl") {
valid_places.emplace_back( valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)}); Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)});
......
...@@ -50,7 +50,14 @@ void OptBase::SetValidPlaces(const std::string& valid_places) { ...@@ -50,7 +50,14 @@ void OptBase::SetValidPlaces(const std::string& valid_places) {
auto target_reprs = lite::Split(valid_places, ","); auto target_reprs = lite::Split(valid_places, ",");
for (auto& target_repr : target_reprs) { for (auto& target_repr : target_reprs) {
if (target_repr == "arm") { if (target_repr == "arm") {
valid_places_.emplace_back(TARGET(kARM)); valid_places_.emplace_back(
Place{TARGET(kARM), PRECISION(kFloat), DATALAYOUT(kNCHW)});
valid_places_.emplace_back(
Place{TARGET(kARM), PRECISION(kInt32), DATALAYOUT(kNCHW)});
valid_places_.emplace_back(
Place{TARGET(kARM), PRECISION(kInt64), DATALAYOUT(kNCHW)});
valid_places_.emplace_back(
Place{TARGET(kARM), PRECISION(kAny), DATALAYOUT(kNCHW)});
} else if (target_repr == "opencl") { } else if (target_repr == "opencl") {
valid_places_.emplace_back( valid_places_.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)}); Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册