diff --git a/mobile/src/operators/elementwise_mul_op.cpp b/mobile/src/operators/elementwise_mul_op.cpp index 9901a36bea813d436a929c31b1e31ebaf924d00f..48b2a4c282c3527460baa4b321badcae89783b5d 100644 --- a/mobile/src/operators/elementwise_mul_op.cpp +++ b/mobile/src/operators/elementwise_mul_op.cpp @@ -32,7 +32,7 @@ namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU REGISTER_OPERATOR_CPU(elementwise_mul, ops::ElementwiseMulOp); #endif -#ifdef PADDLE_MOBILE_CPU +#ifdef PADDLE_MOBILE_CL REGISTER_OPERATOR_CL(elementwise_mul, ops::ElementwiseMulOp); #endif #ifdef PADDLE_MOBILE_FPGA diff --git a/mobile/test/CMakeLists.txt b/mobile/test/CMakeLists.txt index b080a7c458b0d04258f813f94f4eb7cf9d5e5cf0..ccc609ff8300b9220285d73527145379edb30b5a 100644 --- a/mobile/test/CMakeLists.txt +++ b/mobile/test/CMakeLists.txt @@ -544,12 +544,6 @@ else() ADD_EXECUTABLE(test-net net/test_net.cpp test_helper.h test_include.h executor_for_test.h) target_link_libraries(test-net paddle-mobile) - ADD_EXECUTABLE(test-super net/test_super.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-super paddle-mobile) - - ADD_EXECUTABLE(test-inference-pre-post net/test_inference_pre_post.cpp) - target_link_libraries(test-inference-pre-post paddle-mobile) - - ADD_EXECUTABLE(test-inference-super net/test_inference_super.cpp) - target_link_libraries(test-inference-super paddle-mobile) + ADD_EXECUTABLE(test-net-benchmark net/test_net_benchmark.cpp test_helper.h test_include.h) + target_link_libraries(test-net-benchmark paddle-mobile) endif() diff --git a/mobile/test/net/test_net_benchmark.cpp b/mobile/test/net/test_net_benchmark.cpp index f874683148e95180a5c1376e8d6a3233a2cabe1b..396f293f760a3bd8c134c3e3ab34b9f1e2b34219 100644 --- a/mobile/test/net/test_net_benchmark.cpp +++ b/mobile/test/net/test_net_benchmark.cpp @@ -17,20 +17,26 @@ limitations under the License. */ #include "../test_include.h" int main() { +#ifdef PADDLE_MOBILE_CL + paddle_mobile::PaddleMobileConfigInternal config; + config.load_when_predict = false; + paddle_mobile::PaddleMobile paddle_mobile(config); +#else paddle_mobile::PaddleMobile paddle_mobile; +#endif paddle_mobile.SetThreadNum(1); auto time1 = paddle_mobile::time(); - auto isok = - paddle_mobile.Load(std::string(g_yolo) + "/model", - std::string(g_yolo) + "/params", true, false, 1, true); + auto isok = paddle_mobile.Load(std::string(g_mobilenet_combined) + "/model", + std::string(g_mobilenet_combined) + "/params", + true, false, 1, false); if (isok) { auto time2 = paddle_mobile::time(); - std::cout << "load cost :" << paddle_mobile::time_diff(time1, time1) << "ms" + std::cout << "load cost :" << paddle_mobile::time_diff(time1, time2) << "ms" << std::endl; std::vector input; - std::vector dims{1, 3, 64, 64}; + std::vector dims{1, 3, 224, 224}; GetInput(g_test_image_1x3x224x224_banana, &input, dims); paddle_mobile::framework::DDim ddim =