diff --git a/src/operators/fusion_conv_add_bn_relu_op.cpp b/src/operators/fusion_conv_add_bn_relu_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a92eca45a1014ef36cd887e88e364846e693009 --- /dev/null +++ b/src/operators/fusion_conv_add_bn_relu_op.cpp @@ -0,0 +1,4 @@ +// +// Created by Yang,Sui on 2018/6/28. +// + diff --git a/src/operators/fusion_conv_add_bn_relu_op.h b/src/operators/fusion_conv_add_bn_relu_op.h new file mode 100644 index 0000000000000000000000000000000000000000..e265906cb7795715d1219cdb5baf5e5607936e15 --- /dev/null +++ b/src/operators/fusion_conv_add_bn_relu_op.h @@ -0,0 +1,8 @@ +// +// Created by Yang,Sui on 2018/6/28. +// + +#ifndef PADDLE_MOBILE_FUSION_CONV_ADD_BN_RELU_OP_H +#define PADDLE_MOBILE_FUSION_CONV_ADD_BN_RELU_OP_H + +#endif //PADDLE_MOBILE_FUSION_CONV_ADD_BN_RELU_OP_H diff --git a/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a92eca45a1014ef36cd887e88e364846e693009 --- /dev/null +++ b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp @@ -0,0 +1,4 @@ +// +// Created by Yang,Sui on 2018/6/28. +// + diff --git a/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h b/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h new file mode 100644 index 0000000000000000000000000000000000000000..8b98399af883524f764b44ed0d892d582cebe3aa --- /dev/null +++ b/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h @@ -0,0 +1,8 @@ +// +// Created by Yang,Sui on 2018/6/28. +// + +#ifndef PADDLE_MOBILE_CONV_ADD_BN_RELU_FUNC_H +#define PADDLE_MOBILE_CONV_ADD_BN_RELU_FUNC_H + +#endif //PADDLE_MOBILE_CONV_ADD_BN_RELU_FUNC_H diff --git a/src/operators/kernel/conv_add_bn_relu_kernel.h b/src/operators/kernel/conv_add_bn_relu_kernel.h new file mode 100644 index 0000000000000000000000000000000000000000..9f0bca0f8792036d373af6d03393999a67f2e76f --- /dev/null +++ b/src/operators/kernel/conv_add_bn_relu_kernel.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#pragma once + +#ifdef FUSION_CONVADD_BN_RELU_OP + +#include +#include "framework/ddim.h" +#include "framework/operator.h" +#include "operators/math/conv_func.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" +#include "operators/op_param.h" + +namespace paddle_mobile { + namespace operators { + + using framework::DDim; + using framework::OpKernelBase; + + template + class ConvAddBNReluKernel + : public OpKernelBase { + public: + void Compute(const FusionConvAddBNReluParam ¶m) const; + bool Init(const FusionConvAddBNReluParam ¶) const; + }; + + } // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/tools/build.sh b/tools/build.sh index 4ac63315a94798d3aca63fb62aef511c4146cd3c..be60e30dd6188a1d9393a7557af6f7e8e2f96e44 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -31,7 +31,7 @@ build_for_mac() { } build_for_android() { - rm -rf "../build" + #rm -rf "../build" if [ -z "${ANDROID_NDK}" ]; then echo "ANDROID_NDK not found!" exit -1 diff --git a/tools/run.sh b/tools/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..9c04e7051cf090024a79fe902fd87c4718d3cb6f --- /dev/null +++ b/tools/run.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env sh +# auto build and run + +BUILDNET="mobilenetssds" +TESTUNIT="test-mobilenet" + +push_fn () { +#sh build.sh android ${BUILDNET} +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" +adb shell mkdir ${MODELS_DIR} +for file in `ls ${MODELS_SRC}` +do + adb shell mkdir ${MODELS_DIR}"/"${file} +done + +IMAGES_DIR="data/local/tmp/images" +adb shell mkdir ${IMAGES_DIR} +LIB_PATH="../build/release/arm-v7a/build/*" +adb push ${EXE_FILE} ${EXE_DIR} +adb push ${LIB_PATH} ${EXE_DIR} +if [[ $1 != "npm" ]]; then +adb push ${IMAGE_PATH} ${IMAGES_DIR} +adb push ${MODELS_PATH} ${MODELS_DIR} +fi +adb shell "cd /data/local/tmp/bin; LD_LIBRARY_PATH=. ./${TESTUNIT}" +} + +if [[ $1 == "npm" ]]; then +push_fn $1 +else +push_fn +fi