diff --git a/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp index 3380cf5b56ba4ffd9f97b2921d9f2abeb6b125a7..1e67f9cc607a6d51abf31ee95e95bff5b051c781 100644 --- a/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp +++ b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp @@ -15,7 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVADDBNRELU_OP #include "operators/kernel/conv_add_bn_relu_kernel.h" -#include +#include #include "operators/kernel/central-arm-func/conv_add_bn_relu_arm_func.h" namespace paddle_mobile { diff --git a/src/operators/kernel/arm/conv_bn_add_relu_kernel.cpp b/src/operators/kernel/arm/conv_bn_add_relu_kernel.cpp index a0f21dd6126ed81cf5e96f99bd0f8ed5211f96a4..17c9fbd315451af7391ddf0b219fc7f6b7ff22e0 100644 --- a/src/operators/kernel/arm/conv_bn_add_relu_kernel.cpp +++ b/src/operators/kernel/arm/conv_bn_add_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNADDRELU_OP #include "operators/kernel/conv_bn_add_relu_kernel.h" +#include #include "operators/kernel/central-arm-func/conv_bn_add_relu_arm_func.h" namespace paddle_mobile { diff --git a/src/operators/kernel/arm/conv_bn_relu_kernel.cpp b/src/operators/kernel/arm/conv_bn_relu_kernel.cpp index d8acb8d2083b732da026a9bff19c2d7732568597..44c7f463f4cc6e24c5de696b0750e683e6b8b09c 100644 --- a/src/operators/kernel/arm/conv_bn_relu_kernel.cpp +++ b/src/operators/kernel/arm/conv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNRELU_OP #include "operators/kernel/conv_bn_relu_kernel.h" +#include #include "operators/kernel/central-arm-func/conv_bn_relu_arm_func.h" namespace paddle_mobile { diff --git a/src/operators/kernel/arm/dwconv_bn_relu_kernel.cpp b/src/operators/kernel/arm/dwconv_bn_relu_kernel.cpp index f92d9a273467bf15d9d7fad43237af5385d3d54e..60d35302942ec398597c5e02157581c19fe0547c 100644 --- a/src/operators/kernel/arm/dwconv_bn_relu_kernel.cpp +++ b/src/operators/kernel/arm/dwconv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_DWCONVBNRELU_OP #include "operators/kernel/dwconv_bn_relu_kernel.h" +#include #include "operators/kernel/central-arm-func/dwconv_bn_relu_arm_func.h" namespace paddle_mobile { diff --git a/src/operators/kernel/cl/batchnorm_kernel.cpp b/src/operators/kernel/cl/batchnorm_kernel.cpp index 590e8c5cb028ab4acd3a94df28c5c10dd477d51f..ce57e8dc2e1504e0e3a1fe957bded6de5312d5fa 100644 --- a/src/operators/kernel/cl/batchnorm_kernel.cpp +++ b/src/operators/kernel/cl/batchnorm_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef BATCHNORM_OP #include "operators/kernel/batchnorm_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/cl/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/cl/conv_add_bn_relu_kernel.cpp index 33172e4f0343f1bb26e34f6c7d3b009629b60430..3d1e167613a15e470b160fc5864ab11d4a01a81f 100644 --- a/src/operators/kernel/cl/conv_add_bn_relu_kernel.cpp +++ b/src/operators/kernel/cl/conv_add_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVADDBNRELU_OP #include "operators/kernel/conv_add_bn_relu_kernel.h" +#include #include "framework/cl/cl_image.h" #include "framework/cl/cl_tool.h" diff --git a/src/operators/kernel/cl/conv_bn_add_relu_kernel.cpp b/src/operators/kernel/cl/conv_bn_add_relu_kernel.cpp index 4b7352a679afcb1137421040117e9d85d9589e61..b0a7f36ffb612d42b081ffd10c22f2ebc730db7c 100644 --- a/src/operators/kernel/cl/conv_bn_add_relu_kernel.cpp +++ b/src/operators/kernel/cl/conv_bn_add_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNADDRELU_OP #include "operators/kernel/conv_bn_add_relu_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/cl/conv_bn_relu_kernel.cpp b/src/operators/kernel/cl/conv_bn_relu_kernel.cpp index 945f84358ff2f5a61ece0c8f96d39b3c10c01c1e..12a01e28a7c5dce9150104576a62200e01c4267f 100644 --- a/src/operators/kernel/cl/conv_bn_relu_kernel.cpp +++ b/src/operators/kernel/cl/conv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNRELU_OP #include "operators/kernel/conv_bn_relu_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/cl/dwconv_bn_relu_kernel.cpp b/src/operators/kernel/cl/dwconv_bn_relu_kernel.cpp index 31cb654d75c9c83e132a52d740b0b2db1c3a2ccf..03362a8d9f73fc18b13b546eabcd92d51663a65d 100644 --- a/src/operators/kernel/cl/dwconv_bn_relu_kernel.cpp +++ b/src/operators/kernel/cl/dwconv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_DWCONVBNRELU_OP #include "operators/kernel/dwconv_bn_relu_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V1/conv_add_bn_kernel.cpp b/src/operators/kernel/fpga/V1/conv_add_bn_kernel.cpp old mode 100755 new mode 100644 index 5d7e180f01aea4c6357d4638f73fbe51b8c18c17..30ff3155a47c813f303dc59191edd8b60e6d8ce3 --- a/src/operators/kernel/fpga/V1/conv_add_bn_kernel.cpp +++ b/src/operators/kernel/fpga/V1/conv_add_bn_kernel.cpp @@ -15,7 +15,8 @@ limitations under the License. */ #ifdef FUSION_CONVADDBN_OP #include "operators/kernel/conv_add_bn_kernel.h" -#include +#include + namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V1/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/fpga/V1/conv_add_bn_relu_kernel.cpp index 567b42ef08b7047225013ac48eb95262a353082a..7f720323253fff53f7d1bb92f8bfeec77bf0da14 100644 --- a/src/operators/kernel/fpga/V1/conv_add_bn_relu_kernel.cpp +++ b/src/operators/kernel/fpga/V1/conv_add_bn_relu_kernel.cpp @@ -15,7 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVADDBNRELU_OP #include "operators/kernel/conv_add_bn_relu_kernel.h" -#include +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp b/src/operators/kernel/fpga/V1/conv_bn_kernel.cpp old mode 100755 new mode 100644 diff --git a/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp b/src/operators/kernel/fpga/V1/conv_bn_relu_kernel.cpp old mode 100755 new mode 100644 diff --git a/src/operators/kernel/fpga/V1/softmax_kernel.cpp b/src/operators/kernel/fpga/V1/softmax_kernel.cpp index 0cfc3896051095be3f72bfc6008c7a9c27456efd..e5ada795b120c1438688089078be20e03f078cbb 100644 --- a/src/operators/kernel/fpga/V1/softmax_kernel.cpp +++ b/src/operators/kernel/fpga/V1/softmax_kernel.cpp @@ -22,7 +22,7 @@ namespace operators { template <> bool SoftmaxKernel::Init(SoftmaxParam *param) { - auto input = const_cast(param->InputX()); + auto input = const_cast(param->InputX()); auto input_ptr = input->data(); auto out = param->Out(); fpga::format_fp32_ofm(out); diff --git a/src/operators/kernel/fpga/V2/conv_add_bn_kernel.cpp b/src/operators/kernel/fpga/V2/conv_add_bn_kernel.cpp index 82cb872055aed84d28c798e413b86478de6ca0a6..a529a9871966485f46f5e3435fd24ddcbf3cfb07 100644 --- a/src/operators/kernel/fpga/V2/conv_add_bn_kernel.cpp +++ b/src/operators/kernel/fpga/V2/conv_add_bn_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVADDBN_OP #include "operators/kernel/conv_add_bn_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V2/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/fpga/V2/conv_add_bn_relu_kernel.cpp index 266ebe012e0db3ef3b2ac21f81f4436d143ece59..c9cf04fe6773ee3d194945ad5a69154a9c7a07bf 100644 --- a/src/operators/kernel/fpga/V2/conv_add_bn_relu_kernel.cpp +++ b/src/operators/kernel/fpga/V2/conv_add_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVADDBNRELU_OP #include "operators/kernel/conv_add_bn_relu_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V2/conv_bn_kernel.cpp b/src/operators/kernel/fpga/V2/conv_bn_kernel.cpp index cb32c0fe040b9c55de660269fbfc3598ea9722bf..77b6a9a5356270a75723b56f342c133360f44ed6 100644 --- a/src/operators/kernel/fpga/V2/conv_bn_kernel.cpp +++ b/src/operators/kernel/fpga/V2/conv_bn_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBN_OP #include "operators/kernel/conv_bn_kernel.h" +#include namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/fpga/V2/conv_bn_relu_kernel.cpp b/src/operators/kernel/fpga/V2/conv_bn_relu_kernel.cpp index 918b65bd347811f9a2cc6b1182c54d9f39a9082e..c20dfb8911a8fdd32e3097a21deb56f37db11d28 100644 --- a/src/operators/kernel/fpga/V2/conv_bn_relu_kernel.cpp +++ b/src/operators/kernel/fpga/V2/conv_bn_relu_kernel.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef FUSION_CONVBNRELU_OP #include "operators/kernel/conv_bn_relu_kernel.h" +#include #include "fpga/V2/filter.h" namespace paddle_mobile { diff --git a/tools/ci_build.sh b/tools/ci_build.sh index 73ff293d4f14a699679284c6bc4e68a6d0d057c7..f21bcdc67e6f73f61e0b33558672ac61fdf0fb22 100755 --- a/tools/ci_build.sh +++ b/tools/ci_build.sh @@ -26,6 +26,7 @@ function print_usage() { ${BLUE}ios${NONE}: run build for apple ios platform ${BLUE}linux_armv7${NONE}: run build for linux armv7 platform ${BLUE}linux_armv8${NONE}: run build for linux armv8 platform + ${BLUE}fpga${NONE}: run build for fpga platform " echo "\n${RED}Network${NONE}: optional, for deep compressing the framework size ${BLUE}googlenet${NONE}: build only googlenet support @@ -219,11 +220,19 @@ function build_ios() { } function build_linux_armv7() { - check_ndk build_linux_armv7_cpu_only # build_linux_armv7_gpu } +function build_linux_fpga() { + cd .. + image=`docker images paddle-mobile:dev | grep 'paddle-mobile'` + if [[ "x"$image == "x" ]]; then + docker build -t paddle-mobile:dev - < Dockerfile + fi + docker run --rm -v `pwd`:/workspace paddle-mobile:dev bash /workspace/tools/docker_build_fpga.sh +} + function main() { local CMD=$1 init @@ -240,6 +249,9 @@ function main() { linux_armv7) build_linux_armv7 ;; + fpga) + build_linux_fpga + ;; *) print_usage exit 0 diff --git a/tools/docker_build_fpga.sh b/tools/docker_build_fpga.sh new file mode 100644 index 0000000000000000000000000000000000000000..0927c328dd41b87f77adf19d514703e7bcafbce8 --- /dev/null +++ b/tools/docker_build_fpga.sh @@ -0,0 +1,6 @@ +apt-get update +apt-get install -y gcc g++ cmake + +cd /workspace && mkdir build +cd build && cmake .. -DCPU=OFF -DFPGA=ON && make -j4 +