| @@ -135,3 +135,57 @@ jobs: | |||
| export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | |||
| cd build-noint8 | |||
| TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2 | |||
| linux-gcc-armhf-vfpv3-d16: | |||
| runs-on: ubuntu-20.04 | |||
| steps: | |||
| - uses: actions/checkout@v2 | |||
| - name: cache-qemu | |||
| id: cache-qemu | |||
| uses: actions/cache@v2.1.7 | |||
| with: | |||
| path: qemu-install | |||
| key: qemu-arm-install-1 | |||
| - name: checkout-qemu | |||
| if: steps.cache-qemu.outputs.cache-hit != 'true' | |||
| uses: actions/checkout@v2 | |||
| with: | |||
| repository: qemu/qemu | |||
| path: qemu | |||
| ref: 8746309137ba470d1b2e8f5ce86ac228625db940 | |||
| - name: qemu | |||
| if: steps.cache-qemu.outputs.cache-hit != 'true' | |||
| run: | | |||
| cd qemu | |||
| ./configure --prefix=install --target-list=arm-linux-user --disable-system | |||
| make -j2 | |||
| make install | |||
| cp -r arm-linux-user/install $GITHUB_WORKSPACE/qemu-install | |||
| - name: arm-gnu-toolchain | |||
| run: | | |||
| sudo apt-get update | |||
| sudo apt-get install g++-arm-linux-gnueabihf | |||
| - name: build | |||
| run: | | |||
| mkdir build && cd build | |||
| cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. | |||
| cmake --build . -j 2 | |||
| - name: test | |||
| run: | | |||
| export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | |||
| cd build | |||
| TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2 | |||
| - name: build-noint8 | |||
| run: | | |||
| mkdir build-noint8 && cd build-noint8 | |||
| cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DNCNN_INT8=OFF .. | |||
| cmake --build . -j 2 | |||
| - name: test-noint8 | |||
| run: | | |||
| export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | |||
| cd build-noint8 | |||
| TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2 | |||
| @@ -19,7 +19,7 @@ popd | |||
| ##### android armv7 without neon | |||
| mkdir -p build-android-armv7-without-neon | |||
| pushd build-android-armv7-without-neon | |||
| cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_PLATFORM=android-19 .. | |||
| cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DANDROID_PLATFORM=android-19 .. | |||
| make -j4 | |||
| make install | |||
| popd | |||
| @@ -147,7 +147,13 @@ int Convolution1D_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Opti | |||
| w = bottom_blob_bordered.w; | |||
| h = bottom_blob_bordered.h; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| const int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| @@ -524,7 +530,7 @@ int Convolution1D_arm::forward_fp16s(const Mat& bottom_blob, Mat& top_blob, cons | |||
| w = bottom_blob_bordered.w; | |||
| h = bottom_blob_bordered.h; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| const int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| @@ -1196,7 +1202,6 @@ int Convolution1D_arm::create_pipeline_bf16s(const Option& opt) | |||
| int elempack = 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| @@ -1258,7 +1263,13 @@ int Convolution1D_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, cons | |||
| w = bottom_blob_bordered.w; | |||
| h = bottom_blob_bordered.h; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| const int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| @@ -223,8 +223,15 @@ int Convolution_arm::create_pipeline(const Option& opt) | |||
| const int maxk = kernel_w * kernel_h; | |||
| const int num_input = weight_data_size / maxk / num_output; | |||
| int elempack = (support_packing && opt.use_packing_layout && num_input % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int elempack = 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| elempack = num_input % 4 == 0 ? 4 : 1; | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| #if __ARM_NEON | |||
| // pack4 | |||
| @@ -501,7 +508,13 @@ int Convolution_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Option | |||
| int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| int outh = (h - kernel_extent_h) / stride_h + 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| top_blob.create(outw, outh, num_output / out_elempack, out_elemsize, out_elempack, opt.blob_allocator); | |||
| @@ -1384,7 +1397,7 @@ int Convolution_arm::forward_fp16s(const Mat& bottom_blob, Mat& top_blob, const | |||
| int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| int outh = (h - kernel_extent_h) / stride_h + 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| top_blob.create(outw, outh, num_output / out_elempack, out_elemsize, out_elempack, opt.blob_allocator); | |||
| @@ -1908,8 +1921,15 @@ int Convolution_arm::create_pipeline_bf16s(const Option& opt) | |||
| const int maxk = kernel_w * kernel_h; | |||
| const int num_input = weight_data_size / maxk / num_output; | |||
| int elempack = (support_packing && opt.use_packing_layout && num_input % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int elempack = 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| elempack = num_input % 4 == 0 ? 4 : 1; | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| #if __ARM_NEON | |||
| // pack4 | |||
| @@ -2055,7 +2075,13 @@ int Convolution_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, const | |||
| int outw = (w - kernel_extent_w) / stride_w + 1; | |||
| int outh = (h - kernel_extent_h) / stride_h + 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| top_blob.create(outw, outh, num_output / out_elempack, out_elemsize, out_elempack, opt.blob_allocator); | |||
| @@ -535,8 +535,15 @@ int ConvolutionDepthWise_arm::forward(const Mat& bottom_blob, Mat& top_blob, con | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = 1; | |||
| int out_g_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| g_elempack = channels_g % 4 == 0 ? 4 : 1; | |||
| out_g_elempack = num_output_g % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| // unpacking | |||
| Mat bottom_blob_bordered_unpacked = bottom_blob_bordered; | |||
| @@ -856,8 +863,8 @@ int ConvolutionDepthWise_arm::forward_fp16s(const Mat& bottom_blob, Mat& top_blo | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = (opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| // unpacking | |||
| Mat bottom_blob_bordered_unpacked = bottom_blob_bordered; | |||
| @@ -1491,8 +1498,15 @@ int ConvolutionDepthWise_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_blo | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = 1; | |||
| int out_g_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| g_elempack = channels_g % 4 == 0 ? 4 : 1; | |||
| out_g_elempack = num_output_g % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| // unpacking | |||
| Mat bottom_blob_bordered_unpacked = bottom_blob_bordered; | |||
| @@ -120,8 +120,15 @@ int Deconvolution_arm::create_pipeline(const Option& opt) | |||
| } | |||
| } | |||
| int elempack = (support_packing && opt.use_packing_layout && num_input % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int elempack = 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| elempack = num_input % 4 == 0 ? 4 : 1; | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| #if __ARM_NEON | |||
| // pack4 | |||
| @@ -333,7 +340,13 @@ int Deconvolution_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Opti | |||
| int outw = (w - 1) * stride_w + kernel_extent_w + output_pad_right; | |||
| int outh = (h - 1) * stride_h + kernel_extent_h + output_pad_bottom; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat top_blob_bordered; | |||
| @@ -1911,8 +1924,15 @@ int Deconvolution_arm::create_pipeline_bf16s(const Option& opt) | |||
| const int maxk = kernel_w * kernel_h; | |||
| const int num_input = weight_data_size / maxk / num_output; | |||
| int elempack = opt.use_packing_layout && num_input % 4 == 0 ? 4 : 1; | |||
| int out_elempack = opt.use_packing_layout && num_output % 4 == 0 ? 4 : 1; | |||
| int elempack = 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| elempack = num_input % 4 == 0 ? 4 : 1; | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| Mat weight_data_transposed(weight_data.w); | |||
| { | |||
| @@ -1985,7 +2005,13 @@ int Deconvolution_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, cons | |||
| int outw = (w - 1) * stride_w + kernel_extent_w + output_pad_right; | |||
| int outh = (h - 1) * stride_h + kernel_extent_h + output_pad_bottom; | |||
| int out_elempack = opt.use_packing_layout && num_output % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat top_blob_bordered; | |||
| @@ -47,7 +47,13 @@ int DeconvolutionDepthWise_arm::create_pipeline(const Option& opt) | |||
| // depth-wise | |||
| if (channels == group && group == num_output) | |||
| { | |||
| int elempack = (support_packing && opt.use_packing_layout && channels % 4 == 0) ? 4 : 1; | |||
| int elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| elempack = channels % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| Mat weight_data_transposed(weight_data.w); | |||
| { | |||
| @@ -253,7 +259,13 @@ int DeconvolutionDepthWise_arm::forward(const Mat& bottom_blob, Mat& top_blob, c | |||
| int outw = (w - 1) * stride_w + kernel_extent_w + output_pad_right; | |||
| int outh = (h - 1) * stride_h + kernel_extent_h + output_pad_bottom; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat top_blob_bordered; | |||
| @@ -427,8 +439,15 @@ int DeconvolutionDepthWise_arm::forward(const Mat& bottom_blob, Mat& top_blob, c | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = 1; | |||
| int out_g_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| g_elempack = channels_g % 4 == 0 ? 4 : 1; | |||
| out_g_elempack = num_output_g % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| // unpacking | |||
| Mat bottom_blob_unpacked = bottom_blob; | |||
| @@ -493,7 +512,7 @@ int DeconvolutionDepthWise_arm::forward_fp16s(const Mat& bottom_blob, Mat& top_b | |||
| int outw = (w - 1) * stride_w + kernel_extent_w + output_pad_right; | |||
| int outh = (h - 1) * stride_h + kernel_extent_h + output_pad_bottom; | |||
| int out_elempack = (support_packing && opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| int out_elempack = (opt.use_packing_layout && num_output % 4 == 0) ? 4 : 1; | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat top_blob_bordered; | |||
| @@ -648,8 +667,8 @@ int DeconvolutionDepthWise_arm::forward_fp16s(const Mat& bottom_blob, Mat& top_b | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = (opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| // unpacking | |||
| Mat bottom_blob_unpacked = bottom_blob; | |||
| @@ -1008,7 +1027,13 @@ int DeconvolutionDepthWise_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_b | |||
| int outw = (w - 1) * stride_w + kernel_extent_w + output_pad_right; | |||
| int outh = (h - 1) * stride_h + kernel_extent_h + output_pad_bottom; | |||
| int out_elempack = opt.use_packing_layout && num_output % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat top_blob_bordered; | |||
| @@ -1182,8 +1207,15 @@ int DeconvolutionDepthWise_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_b | |||
| const int channels_g = channels * elempack / group; | |||
| const int num_output_g = num_output / group; | |||
| int g_elempack = (support_packing && opt.use_packing_layout && channels_g % 4 == 0) ? 4 : 1; | |||
| int out_g_elempack = (support_packing && opt.use_packing_layout && num_output_g % 4 == 0) ? 4 : 1; | |||
| int g_elempack = 1; | |||
| int out_g_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| g_elempack = channels_g % 4 == 0 ? 4 : 1; | |||
| out_g_elempack = num_output_g % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| // unpacking | |||
| Mat bottom_blob_unpacked = bottom_blob; | |||
| @@ -1543,7 +1543,13 @@ int InnerProduct_arm::create_pipeline_bf16s(const Option& opt) | |||
| { | |||
| const int num_input = weight_data_size / num_output; | |||
| int out_elempack = opt.use_packing_layout && num_output % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif // __ARM_NEON | |||
| // src = inch-outch | |||
| // dst = pb-inch-outch/pb | |||
| @@ -1763,7 +1769,13 @@ int InnerProduct_arm::forward_bf16s(const Mat& bottom_blob, Mat& top_blob, const | |||
| size_t elemsize = bottom_blob_flattened.elemsize; | |||
| int elempack = bottom_blob_flattened.elempack; | |||
| int out_elempack = opt.use_packing_layout && num_output % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = num_output % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif // __ARM_NEON | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| top_blob.create(num_output / out_elempack, out_elemsize, out_elempack, opt.blob_allocator); | |||
| @@ -61,10 +61,12 @@ int PixelShuffle_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Optio | |||
| int outc = channels * elempack / (upscale_factor * upscale_factor); | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = outc % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| if (upscale_factor != 2 || mode != 0) | |||
| @@ -234,6 +236,7 @@ int PixelShuffle_arm::forward_bf16s_fp16s(const Mat& bottom_blob, Mat& top_blob, | |||
| int outc = channels * elempack / (upscale_factor * upscale_factor); | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC | |||
| @@ -242,6 +245,7 @@ int PixelShuffle_arm::forward_bf16s_fp16s(const Mat& bottom_blob, Mat& top_blob, | |||
| out_elempack = outc % 4 == 0 ? 4 : 1; | |||
| #endif | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| if (upscale_factor != 2 || mode != 0) | |||
| @@ -64,7 +64,13 @@ int Slice_arm::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& t | |||
| slice = (w - q) / (top_blobs.size() - i); | |||
| } | |||
| int out_elempack = opt.use_packing_layout && slice % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -95,7 +101,13 @@ int Slice_arm::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& t | |||
| slice = (h - q) / (top_blobs.size() - i); | |||
| } | |||
| int out_elempack = opt.use_packing_layout && slice % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -216,7 +228,13 @@ int Slice_arm::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& t | |||
| slice = (channels - q) / (top_blobs.size() - i); | |||
| } | |||
| int out_elempack = opt.use_packing_layout && slice % 4 == 0 ? 4 : 1; | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -398,6 +416,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| } | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC | |||
| @@ -406,6 +425,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| #endif | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -437,6 +457,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| } | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC | |||
| @@ -445,6 +466,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| #endif | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -628,6 +650,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| } | |||
| int out_elempack = 1; | |||
| #if __ARM_NEON | |||
| if (opt.use_packing_layout) | |||
| { | |||
| #if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC | |||
| @@ -636,6 +659,7 @@ int Slice_arm::forward_bf16s_fp16s(const std::vector<Mat>& bottom_blobs, std::ve | |||
| out_elempack = slice % 4 == 0 ? 4 : 1; | |||
| #endif | |||
| } | |||
| #endif | |||
| size_t out_elemsize = elemsize / elempack * out_elempack; | |||
| Mat& top_blob = top_blobs[i]; | |||
| @@ -243,11 +243,9 @@ static int convolutiondepthwise(const Mat& bottom_blob, Mat& top_blob, const Mat | |||
| float* outptr = top_blob.channel(g * outch_g + p); | |||
| const float* weight_data_ptr = (const float*)weight_data + maxk * inch_g * outch_g * g; | |||
| #if NCNN_SIMPLEOMP | |||
| // shadowed variable for less openmp task args | |||
| const int outw = top_blob.w; | |||
| const int outh = top_blob.h; | |||
| #endif | |||
| for (int i = 0; i < outh; i++) | |||
| { | |||
| @@ -0,0 +1,16 @@ | |||
| set(CMAKE_SYSTEM_NAME Linux) | |||
| set(CMAKE_SYSTEM_PROCESSOR arm) | |||
| set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc") | |||
| set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++") | |||
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |||
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |||
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |||
| set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16") | |||
| set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16") | |||
| # cache flags | |||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") | |||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags") | |||