From ff57450d53af11a0e943e634cf33ced4f0bfb886 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Wed, 27 May 2020 19:58:05 +0800 Subject: [PATCH] [Opt] Expand the `precisions\data_layout\targets` types supported by current opt (#3715) --- lite/api/opt.cc | 4 ++++ lite/api/opt_base.cc | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lite/api/opt.cc b/lite/api/opt.cc index a1b963ac4e..4956c1ae39 100644 --- a/lite/api/opt.cc +++ b/lite/api/opt.cc @@ -92,6 +92,10 @@ std::vector ParserValidPlaces() { 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") { valid_places.emplace_back( Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)}); diff --git a/lite/api/opt_base.cc b/lite/api/opt_base.cc index 03f03a4d96..36d5891eb5 100644 --- a/lite/api/opt_base.cc +++ b/lite/api/opt_base.cc @@ -50,7 +50,14 @@ void OptBase::SetValidPlaces(const std::string& valid_places) { auto target_reprs = lite::Split(valid_places, ","); for (auto& target_repr : target_reprs) { 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") { valid_places_.emplace_back( Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)}); -- GitLab