diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index 39b3cc24852b9bfa1f971e0f62bc6a28ba2a8325..438d0f9c9744839848bd6021e595d91c9142baaf 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -246,14 +246,14 @@ endif() # Some bins if(NOT IOS) lite_cc_binary(test_model_bin SRCS model_test.cc DEPS paddle_api_full paddle_api_light gflags utils - ${ops} + ${ops} ${host_kernels} ARM_DEPS ${arm_kernels} NPU_DEPS ${npu_kernels} CL_DEPS ${opencl_kernels} FPGA_DEPS ${fpga_kernels} X86_DEPS ${x86_kernels}) lite_cc_binary(benchmark_bin SRCS benchmark.cc DEPS paddle_api_full paddle_api_light gflags utils - ${ops} + ${ops} ${host_kernels} ARM_DEPS ${arm_kernels} NPU_DEPS ${npu_kernels} CL_DEPS ${opencl_kernels} diff --git a/lite/api/benchmark.cc b/lite/api/benchmark.cc index 3fabd33dc0faf9f3277c0fc7dd5384dc1b2ac04e..02313554d9bd36d4818a53213cd1fd1fe74c8e56 100644 --- a/lite/api/benchmark.cc +++ b/lite/api/benchmark.cc @@ -18,6 +18,9 @@ #include #include #include "lite/api/paddle_api.h" +#include "lite/api/paddle_use_kernels.h" +#include "lite/api/paddle_use_ops.h" +#include "lite/api/paddle_use_passes.h" #include "lite/api/test_helper.h" #include "lite/core/device_info.h" #include "lite/utils/cp_logging.h" @@ -39,11 +42,14 @@ void OutputOptModel(const std::string& load_model_dir, const std::vector>& input_shapes) { lite_api::CxxConfig config; config.set_model_dir(load_model_dir); - config.set_preferred_place(Place{TARGET(kX86), PRECISION(kFloat)}); config.set_valid_places({ - Place{TARGET(kX86), PRECISION(kFloat)}, Place{TARGET(kARM), PRECISION(kFloat)}, + Place{TARGET(kARM), PRECISION(kInt8)}, + Place{TARGET(kX86), PRECISION(kFloat)}, + Place{TARGET(kOpenCL), PRECISION(kFloat)}, + Place{TARGET(kHost), PRECISION(kFloat)}, }); + config.set_preferred_place(Place{TARGET(kARM), PRECISION(kFloat)}); auto predictor = lite_api::CreatePaddlePredictor(config); int ret = system( @@ -67,11 +73,7 @@ void Run(const std::vector>& input_shapes, const std::string model_name) { lite_api::MobileConfig config; config.set_threads(thread_num); - if (thread_num == 1) { - config.set_power_mode(LITE_POWER_NO_BIND); - } else { - config.set_power_mode(LITE_POWER_NO_BIND); - } + config.set_power_mode(LITE_POWER_NO_BIND); config.set_model_dir(model_dir); auto predictor = lite_api::CreatePaddlePredictor(config); diff --git a/lite/api/model_test.cc b/lite/api/model_test.cc index 4db08f70047c76cd9cdda7fa278380ec679250af..114d1acdbe1aa3e73bfa593a7a8950eacf3d415d 100644 --- a/lite/api/model_test.cc +++ b/lite/api/model_test.cc @@ -16,6 +16,9 @@ #include #include #include "lite/api/paddle_api.h" +#include "lite/api/paddle_use_kernels.h" +#include "lite/api/paddle_use_ops.h" +#include "lite/api/paddle_use_passes.h" #include "lite/api/test_helper.h" #include "lite/core/device_info.h" #include "lite/utils/cp_logging.h"