diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bc4f6a40c583ff5c6756f5d35bd581e8c9a7340a..d8abf7b366e452352f00264948db6be562b4d5b0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -217,9 +217,9 @@ else () # ADD_EXECUTABLE(test-depthwise-conv-op operators/test_depthwise_conv_op.cpp test_helper.h test_include.h executor_for_test.h) # target_link_libraries(test-depthwise-conv-op paddle-mobile) # -# # gen test -# ADD_EXECUTABLE(test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h) -# target_link_libraries(test-mobilenet paddle-mobile) + # gen test + ADD_EXECUTABLE(test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h) + target_link_libraries(test-mobilenet paddle-mobile) # # # gen test # ADD_EXECUTABLE(test-conv-add-relu-op operators/test_conv_add_relu_op.cpp test_helper.h test_include.h executor_for_test.h) diff --git a/test/net/test_mobilenet.cpp b/test/net/test_mobilenet.cpp index 4ed7d3b756cfef9554028e1d33f4dd86bf58e4b8..fbe92c96528e055b3e4ca6eb95b1939a6a14bdb2 100644 --- a/test/net/test_mobilenet.cpp +++ b/test/net/test_mobilenet.cpp @@ -19,14 +19,14 @@ limitations under the License. */ int main() { paddle_mobile::PaddleMobile paddle_mobile; paddle_mobile.SetThreadNum(4); - auto time1 = time(); + auto time1 = paddle_mobile::time(); // auto isok = paddle_mobile.Load(std::string(g_mobilenet_detect) + "/model", // std::string(g_mobilenet_detect) + "/params", true); auto isok = paddle_mobile.Load(g_mobilenet, true); if (isok) { - auto time2 = time(); - std::cout << "load cost :" << time_diff(time1, time1) << "ms" << std::endl; + auto time2 = paddle_mobile::time(); + std::cout << "load cost :" << paddle_mobile::time_diff(time1, time1) << "ms" << std::endl; std::vector input; std::vector dims{1, 3, 224, 224}; @@ -42,13 +42,13 @@ int main() { for (int i = 0; i < 10; ++i) { auto vec_result = paddle_mobile.Predict(input, dims); } - auto time3 = time(); + auto time3 = paddle_mobile::time(); for (int i = 0; i < 10; ++i) { auto vec_result = paddle_mobile.Predict(input, dims); } DLOG << vec_result; - auto time4 = time(); - std::cout << "predict cost :" << time_diff(time3, time4) / 10 << "ms" + auto time4 = paddle_mobile::time(); + std::cout << "predict cost :" << paddle_mobile::time_diff(time3, time4) / 10 << "ms" << std::endl; } diff --git a/tools/android-debug-script/push2android.sh b/tools/android-debug-script/push2android.sh index 14664b4051f69af5f803734bb04fb5a8654b341b..1ea6c49e058f5871e2570a7bea6f91d575fcac94 100644 --- a/tools/android-debug-script/push2android.sh +++ b/tools/android-debug-script/push2android.sh @@ -1,21 +1,16 @@ #!/usr/bin/env sh push_fn () { - - -cp ../../src/operators/kernel/cl/cl_kernel/* ../../build/release/arm-v7a/build/cl_kernel/ - - MODELS_PATH="../../test/models/*" MODELS_SRC="../../test/models" IMAGE_PATH="../../test/images/*" EXE_FILE="../../test/build/*" EXE_DIR="data/local/tmp/bin" adb shell mkdir ${EXE_DIR} -MODELS_DIR="data/local/tmp/models" +MODELS_DIR="/data/local/tmp" adb shell mkdir ${MODELS_DIR} for file in `ls ${MODELS_SRC}` -do +do adb shell mkdir ${MODELS_DIR}"/"${file} done @@ -24,11 +19,15 @@ ACL_BUILD_PATH="../../src/operators/kernel/mali/ACL_Android/build/*" adb push ${ACL_BUILD_PATH} ${EXE_DIR} fi -IMAGES_DIR="data/local/tmp/images" +IMAGES_DIR="/data/local/tmp" adb shell mkdir ${IMAGES_DIR} LIB_PATH="../../build/release/arm-v7a/build/*" adb push ${EXE_FILE} ${EXE_DIR} -adb push ${LIB_PATH} ${EXE_DIR} +for file in ${LIB_PATH} +do + adb push ${file} ${EXE_DIR} +done + if [[ $1 != "npm" ]]; then adb push ${IMAGE_PATH} ${IMAGES_DIR} adb push ${MODELS_PATH} ${MODELS_DIR}