camenduru commited on
Commit
be903e2
·
1 Parent(s): a1825e7

thanks to ncnn ❤

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .astylerc +35 -0
  2. .ci/linux-x64-cpu-gcc.yml +119 -0
  3. .ci/pnnx.yml +125 -0
  4. .ci/test-coverage.yml +910 -0
  5. .clang-format +132 -0
  6. .gitattributes +47 -35
  7. .github/ISSUE_TEMPLATE/bug.md +15 -0
  8. .github/ISSUE_TEMPLATE/model-convert.md +14 -0
  9. .github/ISSUE_TEMPLATE/others.md +6 -0
  10. .github/ISSUE_TEMPLATE/quantization.md +13 -0
  11. .github/dependabot.yml +6 -0
  12. .github/workflows/android-armv7-cpu.yml +56 -0
  13. .github/workflows/android-armv7-gpu.yml +45 -0
  14. .github/workflows/android-armv8-cpu.yml +41 -0
  15. .github/workflows/android-armv8-gpu.yml +75 -0
  16. .github/workflows/android-x64-cpu.yml +41 -0
  17. .github/workflows/android-x64-gpu.yml +45 -0
  18. .github/workflows/android-x86-cpu.yml +41 -0
  19. .github/workflows/android-x86-gpu.yml +45 -0
  20. .github/workflows/code-format.yml +61 -0
  21. .github/workflows/codeql-analysis.yml +84 -0
  22. .github/workflows/elf-riscv32-cpu-gcc.yml +126 -0
  23. .github/workflows/elf-riscv64-cpu-gcc.yml +123 -0
  24. .github/workflows/ios-arm64-gpu.yml +146 -0
  25. .github/workflows/ios-cpu.yml +140 -0
  26. .github/workflows/ios-simulator-gpu.yml +146 -0
  27. .github/workflows/ios-simulator.yml +142 -0
  28. .github/workflows/linux-aarch64-cpu-gcc.yml +193 -0
  29. .github/workflows/linux-arm-cpu-gcc.yml +206 -0
  30. .github/workflows/linux-loongarch64-cpu-gcc.yml +77 -0
  31. .github/workflows/linux-mips-cpu-gcc.yml +126 -0
  32. .github/workflows/linux-mips64-cpu-gcc.yml +138 -0
  33. .github/workflows/linux-ppc64-cpu-gcc.yml +167 -0
  34. .github/workflows/linux-riscv64-cpu-gcc.yml +192 -0
  35. .github/workflows/linux-riscv64-cpu-gnu-clang.yml +142 -0
  36. .github/workflows/linux-x64-cpu-clang-python.yml +68 -0
  37. .github/workflows/linux-x64-cpu-clang.yml +128 -0
  38. .github/workflows/linux-x64-cpu-gcc-musl.yml +67 -0
  39. .github/workflows/linux-x64-cpu-gcc-san.yml +42 -0
  40. .github/workflows/linux-x64-cpu-gcc-sde.yml +57 -0
  41. .github/workflows/linux-x64-cpu-gcc.yml +134 -0
  42. .github/workflows/linux-x64-gpu-clang-python.yml +113 -0
  43. .github/workflows/linux-x64-gpu-clang.yml +91 -0
  44. .github/workflows/linux-x64-gpu-gcc.yml +128 -0
  45. .github/workflows/linux-x86-cpu-clang.yml +67 -0
  46. .github/workflows/linux-x86-cpu-gcc.yml +65 -0
  47. .github/workflows/mac-catalyst-arm64-cpu.yml +103 -0
  48. .github/workflows/mac-catalyst-arm64-gpu.yml +117 -0
  49. .github/workflows/mac-catalyst-x64-cpu.yml +111 -0
  50. .github/workflows/mac-catalyst-x64-gpu.yml +125 -0
.astylerc ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # astyle -n -r "benchmark/*.h,*.cpp" "src/*.h,*.cpp" "tests/*.h,*.cpp" "tools/*.h,*.cpp" "examples/*.h,*.cpp"
2
+
3
+ # brace style
4
+ --style=allman
5
+
6
+ # tab
7
+ --attach-namespaces
8
+ --attach-extern-c
9
+ --attach-closing-while
10
+
11
+ # indentation
12
+ --indent-preproc-define
13
+ --indent-col1-comments
14
+ --min-conditional-indent=0
15
+ --max-continuation-indent=120
16
+
17
+ # padding
18
+ --pad-oper
19
+ --pad-comma
20
+ --pad-header
21
+ --align-pointer=type
22
+ --align-reference=type
23
+
24
+ # formatting
25
+ --break-closing-braces
26
+ --attach-return-type
27
+ --attach-return-type-decl
28
+ --keep-one-line-blocks
29
+ --keep-one-line-statements
30
+ --convert-tabs
31
+ --max-code-length=200
32
+ --mode=c
33
+
34
+ # other
35
+ --lineend=linux
.ci/linux-x64-cpu-gcc.yml ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.ci/linux-x64-cpu-gcc.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'tests/**'
13
+ - 'tools/**'
14
+ - '!tools/pnnx/**'
15
+ - 'examples/**'
16
+ mr:
17
+ target-branches: [master]
18
+ paths:
19
+ - '.ci/linux-x64-cpu-gcc.yml'
20
+ - 'CMakeLists.txt'
21
+ - 'cmake/**'
22
+ - 'src/*'
23
+ - 'src/layer/*'
24
+ - 'src/layer/x86/**'
25
+ - 'tests/**'
26
+ - 'tools/**'
27
+ - '!tools/pnnx/**'
28
+ - 'examples/**'
29
+ concurrency:
30
+ group: linux-x64-cpu-gcc-${{ ci.head_ref }}
31
+
32
+ jobs:
33
+ linux-gcc:
34
+ name: linux-gcc
35
+ strategy:
36
+ matrix:
37
+ include:
38
+ - { SSE2: 'OFF', AVX: 'OFF', AVX2: 'OFF', AVX512: 'OFF' }
39
+ - { SSE2: 'ON', AVX: 'OFF', AVX2: 'OFF', AVX512: 'OFF' }
40
+ - { SSE2: 'ON', AVX: 'ON', AVX2: 'OFF', AVX512: 'OFF' }
41
+ - { SSE2: 'ON', AVX: 'ON', AVX2: 'ON', AVX512: 'OFF' }
42
+ - { SSE2: 'ON', AVX: 'ON', AVX2: 'ON', AVX512: 'ON' }
43
+
44
+ runs-on:
45
+ pool-name: docker
46
+ container:
47
+ image: bkci/ci:ubuntu
48
+ steps:
49
+ - name: checkout
50
+ checkout: self
51
+ with:
52
+ strategy: FRESH_CHECKOUT
53
+ enableSubmodule: false
54
+ enableGitLfs: false
55
+
56
+ - name: install-deps
57
+ run: |
58
+ apt-get update
59
+ apt-get install -y libprotobuf-dev protobuf-compiler libopencv-dev
60
+
61
+ - name: build
62
+ run: |
63
+ mkdir build && cd build
64
+ cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_BUILD_TESTS=ON ..
65
+ cmake --build . -j $(nproc)
66
+ - name: test
67
+ run: cd build && ctest --output-on-failure -j $(nproc)
68
+ - name: build-shared
69
+ run: |
70
+ mkdir build-shared && cd build-shared
71
+ cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_SHARED_LIB=ON ..
72
+ cmake --build . -j $(nproc)
73
+ - name: build-noint8
74
+ run: |
75
+ mkdir build-noint8 && cd build-noint8
76
+ cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_INT8=OFF -DNCNN_BUILD_TESTS=ON ..
77
+ cmake --build . -j $(nproc)
78
+ - name: test-noint8
79
+ run: cd build-noint8 && ctest --output-on-failure -j $(nproc)
80
+
81
+ linux-gcc-cpp03-nostdio-nostring-simplestl:
82
+ runs-on:
83
+ pool-name: docker
84
+ container:
85
+ image: bkci/ci:ubuntu
86
+ steps:
87
+ - name: checkout
88
+ checkout: self
89
+ with:
90
+ strategy: FRESH_CHECKOUT
91
+ enableSubmodule: false
92
+ enableGitLfs: false
93
+
94
+ - name: build-nostdio
95
+ run: |
96
+ mkdir build-nostdio && cd build-nostdio
97
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-c++03.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
98
+ cmake --build . -j $(nproc)
99
+ - name: test-nostdio
100
+ run: cd build-nostdio && ctest --output-on-failure -j $(nproc)
101
+ - name: build-nostdio-nostring
102
+ run: |
103
+ mkdir build-nostdio-nostring && cd build-nostdio-nostring
104
+ cmake -DNCNN_STDIO=OFF -DNCNN_STRING=OFF -DNCNN_BUILD_TESTS=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
105
+ cmake --build . -j $(nproc)
106
+ - name: build-simplestl
107
+ run: |
108
+ mkdir build-simplestl && cd build-simplestl
109
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.gcc.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
110
+ cmake --build . -j $(nproc)
111
+ - name: test-simplestl
112
+ run: cd build-simplestl && ctest --output-on-failure -j $(nproc)
113
+ - name: build-simplestl-simpleomp
114
+ run: |
115
+ mkdir build-simplestl-simpleomp && cd build-simplestl-simpleomp
116
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.gcc.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_SIMPLEOMP=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
117
+ cmake --build . -j $(nproc)
118
+ - name: test-simplestl-simpleomp
119
+ run: cd build-simplestl-simpleomp && ctest --output-on-failure -j $(nproc)
.ci/pnnx.yml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: pnnx
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.ci/pnnx.yml'
7
+ - 'tools/pnnx/**'
8
+ - '!tools/pnnx/README.md'
9
+ mr:
10
+ target-branches: [master]
11
+ paths:
12
+ - '.ci/pnnx.yml'
13
+ - 'tools/pnnx/**'
14
+ - '!tools/pnnx/README.md'
15
+ concurrency:
16
+ group: pnnx-${{ ci.head_ref }}
17
+
18
+ jobs:
19
+ ubuntu:
20
+ strategy:
21
+ matrix:
22
+ include:
23
+ - torch-version: 1.8.1
24
+ torchvision-version: 0.9.1
25
+ torchvision-cache-key: '0_9_1'
26
+
27
+ - torch-version: 1.9.1
28
+ torchvision-version: 0.10.1
29
+ torchvision-cache-key: '0_10_1'
30
+
31
+ - torch-version: 1.10.0
32
+ torchvision-version: 0.11.1
33
+ torchvision-cache-key: '0_11_1'
34
+
35
+ - torch-version: 1.11.0
36
+ torchvision-version: 0.12.0
37
+ torchvision-cache-key: '0_12_0'
38
+
39
+ - torch-version: 1.12.0
40
+ torchvision-version: 0.13.0
41
+ torchvision-cache-key: '0_13_0'
42
+
43
+ - torch-version: 1.13.0
44
+ torchvision-version: 0.14.0
45
+ torchvision-cache-key: '0_14_0'
46
+
47
+ - torch-version: 2.0.0
48
+ torchvision-version: 0.15.1
49
+ torchvision-cache-key: '0_15_1'
50
+
51
+ runs-on:
52
+ pool-name: docker
53
+ container:
54
+ image: bkci/ci:ubuntu
55
+ steps:
56
+ - name: checkout
57
+ checkout: self
58
+ with:
59
+ strategy: FRESH_CHECKOUT
60
+ enableGitLfs: false
61
+
62
+ - name: install-deps
63
+ run: |
64
+ apt-get update
65
+ apt-get install -y python3-pip libjpeg-dev libpng-dev libprotobuf-dev protobuf-compiler
66
+ python3 -m pip install --upgrade pip
67
+ apt-get remove -y python3-setuptools
68
+ pip3 install -U setuptools
69
+ pip3 install -U pytest wheel twine requests einops
70
+
71
+ - name: setup pytorch
72
+ run: |
73
+ export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
74
+ pip3 install --user torch==${{matrix.torch-version}}+cpu torchvision==${{matrix.torchvision-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
75
+
76
+ - name: cache-torchvision
77
+ id: cache-torchvision
78
+ uses: cache@1.*
79
+ with:
80
+ cachePaths: torchvision-${{matrix.torchvision-version}}-install
81
+ cacheKey: torchvision-${{matrix.torchvision-cache-key}}-linux-install-20211228
82
+ - name: checkout-torchvision
83
+ if: steps.cache-torchvision.outputs.cacheHit != 'true'
84
+ checkout: https://github.com/pytorch/vision.git
85
+ with:
86
+ pullType: TAG
87
+ refName: v${{matrix.torchvision-version}}
88
+ localPath: vision
89
+ enableSubmodule: false
90
+ enableGitLfs: false
91
+ - name: torchvision
92
+ if: steps.cache-torchvision.outputs.cacheHit != 'true'
93
+ run: |
94
+ cd vision
95
+ mkdir -p build; cd build
96
+ cmake -DCMAKE_INSTALL_PREFIX=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install -DTorch_DIR=${{ci.workspace}}/torch-${{matrix.torch-version}}/lib/python3.9/site-packages/torch/share/cmake/Torch -DCMAKE_BUILD_TYPE=Release ..
97
+ cmake --build . -j $(nproc)
98
+ cmake --build . --target install
99
+
100
+ - name: build-ncnn
101
+ run: |
102
+ export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
103
+ mkdir build && cd build
104
+ cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_PYTHON=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
105
+ cmake --build . -j $(nproc)
106
+ cd ..
107
+ export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
108
+ pip3 install --user .
109
+
110
+ - name: build-pnnx
111
+ run: |
112
+ export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
113
+ cd tools/pnnx
114
+ mkdir build && cd build
115
+ cmake -DCMAKE_BUILD_TYPE=Release -DTorchVision_INSTALL_DIR=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install ..
116
+ cmake --build . -j 16
117
+
118
+ - name: test
119
+ run: |
120
+ export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
121
+ export OMP_NUM_THREADS=1
122
+ export MKL_NUM_THREADS=1
123
+ export MKL_ENABLE_INSTRUCTIONS=SSE4_2
124
+ cd tools/pnnx
125
+ cd build && ctest --output-on-failure -j 16
.ci/test-coverage.yml ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: test-coverage
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.ci/test-coverage.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/**'
10
+ - 'tests/**'
11
+ - 'toolchains/**'
12
+ mr:
13
+ target-branches: [master]
14
+ paths:
15
+ - '.ci/test-coverage.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/**'
19
+ - 'tests/**'
20
+ - 'toolchains/**'
21
+ concurrency:
22
+ group: test-coverage-${{ ci.head_ref }}
23
+
24
+ jobs:
25
+ linux-gcc-gpu:
26
+ name: linux-gcc-gpu
27
+ runs-on:
28
+ pool-name: docker
29
+ container:
30
+ image: bkci/ci:ubuntu
31
+ steps:
32
+ - name: checkout
33
+ checkout: self
34
+ with:
35
+ strategy: FRESH_CHECKOUT
36
+ enableGitLfs: false
37
+
38
+ - name: install-deps
39
+ run: |
40
+ apt-get update
41
+ apt-get install -y lcov libvulkan-dev
42
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
43
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
44
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
45
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
46
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
47
+ shasum -a 256 -c codecov.SHA256SUM
48
+ chmod +x codecov
49
+
50
+ - name: cache-swiftshader
51
+ id: cache-swiftshader
52
+ uses: cache@1.*
53
+ with:
54
+ cachePaths: swiftshader-install
55
+ cacheKey: swiftshader-linux-install-20230420-1
56
+
57
+ - name: checkout-swiftshader
58
+ if: steps.cache-swiftshader.outputs.cacheHit != 'true'
59
+ checkout: https://github.com/google/swiftshader.git
60
+ with:
61
+ pullType: COMMIT_ID
62
+ refName: dd55e592406dc0bae219df11adec6363840aff4a
63
+ localPath: swiftshader
64
+ enableSubmodule: false
65
+ enableGitLfs: false
66
+
67
+ - name: swiftshader
68
+ if: steps.cache-swiftshader.outputs.cacheHit != 'true'
69
+ run: |
70
+ cd swiftshader
71
+ git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive
72
+ mkdir -p build; cd build
73
+ cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release ..
74
+ cmake --build . -j $(nproc)
75
+ mkdir ${{ci.workspace}}/swiftshader-install
76
+ cp Linux/* ${{ci.workspace}}/swiftshader-install
77
+
78
+ - name: build
79
+ run: |
80
+ mkdir build && cd build
81
+ cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
82
+ cmake --build . -j $(nproc)
83
+ - name: test
84
+ run: |
85
+ printf "[Processor]\nThreadCount=4\n" > build/tests/SwiftShader.ini
86
+ export VK_ICD_FILENAMES="${{ci.workspace}}/swiftshader-install/vk_swiftshader_icd.json"
87
+ cd build && ctest --output-on-failure -j 4
88
+ - name: lcov-collect
89
+ run: |
90
+ cd build
91
+ lcov -d ./src -c -o lcov.info
92
+ lcov -r lcov.info '/usr/*' -o lcov.info
93
+ lcov -r lcov.info '*/build/*' -o lcov.info
94
+ lcov -r lcov.info '*/glslang/*' -o lcov.info
95
+ lcov --list lcov.info
96
+ - name: codecov
97
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
98
+
99
+ linux-gcc-gpu-lavapipe:
100
+ name: linux-gcc-gpu-lavapipe
101
+ runs-on:
102
+ pool-name: docker
103
+ container:
104
+ image: bkci/ci:ubuntu
105
+ steps:
106
+ - name: checkout
107
+ checkout: self
108
+ with:
109
+ strategy: FRESH_CHECKOUT
110
+ enableGitLfs: false
111
+
112
+ - name: install-deps
113
+ run: |
114
+ apt-get update
115
+ apt-get install -y lcov libvulkan-dev libxcb-shm0
116
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
117
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
118
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
119
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
120
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
121
+ shasum -a 256 -c codecov.SHA256SUM
122
+ chmod +x codecov
123
+
124
+ - name: cache-lavapipe
125
+ id: cache-lavapipe
126
+ uses: cache@1.*
127
+ with:
128
+ cachePaths: lavapipe-install
129
+ cacheKey: lavapipe-linux-install-20211127-4
130
+
131
+ - name: checkout-lavapipe
132
+ if: steps.cache-lavapipe.outputs.cacheHit != 'true'
133
+ checkout: https://github.com/mesa3d/mesa.git
134
+ with:
135
+ pullType: COMMIT_ID
136
+ refName: cd39180cfab20734744b379b085cc3b5c2cecd3a
137
+ localPath: mesa
138
+ enableSubmodule: false
139
+ enableGitLfs: false
140
+
141
+ - name: lavapipe
142
+ if: steps.cache-lavapipe.outputs.cacheHit != 'true'
143
+ run: |
144
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
145
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
146
+ apt-get update
147
+ apt-get build-dep -y mesa
148
+ mkdir -p "${{ci.workspace}}/lavapipe-install"
149
+ cd mesa
150
+ mkdir build
151
+ cd build
152
+ meson -Dprefix="${{ci.workspace}}/lavapipe-install" -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dplatforms="x11" -Ddri3=enabled -Ddri-drivers="" -Dgallium-drivers=swrast -Dgallium-vdpau=disabled -Dgallium-xvmc=disabled -Dgallium-omx=disabled -Dgallium-va=disabled -Dgallium-xa=disabled -Dgallium-opencl=disabled -Dopencl-native=false -Dvulkan-drivers=swrast -Dshader-cache=disabled -Dgles1=disabled -Dgles2=disabled -Dopengl=false -Dgbm=disabled -Dglx=disabled -Degl=disabled -Dllvm=enabled -Dvalgrind=disabled -Dlibunwind=disabled -Dlmsensors=disabled ..
153
+ ninja -j$(nproc)
154
+ ninja install
155
+ find ${{ci.workspace}}/lavapipe-install
156
+ cat ${{ci.workspace}}/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json
157
+
158
+ - name: build
159
+ run: |
160
+ mkdir build && cd build
161
+ cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
162
+ cmake --build . -j $(nproc)
163
+ - name: test
164
+ run: |
165
+ export LP_NUM_THREADS=4
166
+ export VK_ICD_FILENAMES="${{ci.workspace}}/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json"
167
+ cd build
168
+ ctest --output-on-failure -j 4
169
+ - name: lcov-collect
170
+ run: |
171
+ cd build
172
+ lcov -d ./src -c -o lcov.info
173
+ lcov -r lcov.info '/usr/*' -o lcov.info
174
+ lcov -r lcov.info '*/build/*' -o lcov.info
175
+ lcov -r lcov.info '*/glslang/*' -o lcov.info
176
+ lcov --list lcov.info
177
+ - name: codecov
178
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
179
+
180
+ linux-gcc-x64:
181
+ name: linux-gcc-x64
182
+ strategy:
183
+ matrix:
184
+ # openmp: ['OFF', 'ON']
185
+ include:
186
+ - { SSE2: 'OFF', AVX: 'OFF', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'}
187
+ - { SSE2: 'ON', AVX: 'OFF', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'}
188
+ - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'}
189
+ - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'ON', FMA: 'ON', AVX2: 'ON', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'}
190
+ - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'ON', FMA: 'ON', AVX2: 'ON', AVX512: 'ON', AVX512VNNI: 'ON', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'}
191
+
192
+ runs-on:
193
+ pool-name: docker
194
+ container:
195
+ image: bkci/ci:ubuntu
196
+ steps:
197
+ - name: checkout
198
+ checkout: self
199
+ with:
200
+ strategy: FRESH_CHECKOUT
201
+ enableSubmodule: false
202
+ enableGitLfs: false
203
+
204
+ - name: install-deps
205
+ run: |
206
+ apt-get update
207
+ apt-get install -y lcov
208
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
209
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
210
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
211
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
212
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
213
+ shasum -a 256 -c codecov.SHA256SUM
214
+ chmod +x codecov
215
+
216
+ - name: build
217
+ run: |
218
+ mkdir build && cd build
219
+ cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON \
220
+ -DNCNN_SSE2=${{matrix.SSE2}} \
221
+ -DNCNN_AVX=${{matrix.AVX}} \
222
+ -DNCNN_XOP=${{matrix.XOP}} \
223
+ -DNCNN_F16C=${{matrix.F16C}} \
224
+ -DNCNN_FMA=${{matrix.FMA}} \
225
+ -DNCNN_AVX2=${{matrix.AVX2}} \
226
+ -DNCNN_AVX512=${{matrix.AVX512}} \
227
+ -DNCNN_AVXVNNI=${{matrix.AVXVNNI}} \
228
+ -DNCNN_AVX512VNNI=${{matrix.AVX512VNNI}} \
229
+ -DNCNN_AVX512BF16=${{matrix.AVX512BF16}} \
230
+ -DNCNN_AVX512FP16=${{matrix.AVX512FP16}} \
231
+ ..
232
+ cmake --build . -j $(nproc)
233
+ - name: test
234
+ run: cd build && ctest --output-on-failure -j $(nproc)
235
+ - name: lcov-collect
236
+ run: |
237
+ cd build
238
+ lcov -d ./src -c -o lcov.info
239
+ lcov -r lcov.info '/usr/*' -o lcov.info
240
+ lcov -r lcov.info '*/build/*' -o lcov.info
241
+ lcov --list lcov.info
242
+ - name: codecov
243
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
244
+
245
+ linux-gcc-arm:
246
+ name: linux-gcc-arm
247
+ strategy:
248
+ matrix:
249
+ # openmp: ['OFF', 'ON']
250
+ include:
251
+ - { GNU_INLINE_ASM: 'ON'}
252
+ - { GNU_INLINE_ASM: 'OFF'}
253
+
254
+ runs-on:
255
+ pool-name: docker
256
+ container:
257
+ image: bkci/ci:ubuntu
258
+ steps:
259
+ - name: checkout
260
+ checkout: self
261
+ with:
262
+ strategy: FRESH_CHECKOUT
263
+ enableSubmodule: false
264
+ enableGitLfs: false
265
+
266
+ - name: install-deps
267
+ run: |
268
+ apt-get update
269
+ apt-get install -y lcov g++-arm-linux-gnueabi g++-arm-linux-gnueabihf libcapstone4 libglib2.0-0
270
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
271
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
272
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
273
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
274
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
275
+ shasum -a 256 -c codecov.SHA256SUM
276
+ chmod +x codecov
277
+
278
+ - name: cache-qemu
279
+ id: cache-qemu
280
+ uses: cache@1.*
281
+ with:
282
+ cachePaths: qemu-install
283
+ cacheKey: qemu-arm-install-20220831-1
284
+
285
+ - name: checkout-qemu
286
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
287
+ checkout: https://github.com/qemu/qemu.git
288
+ with:
289
+ pullType: COMMIT_ID
290
+ refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
291
+ localPath: qemu
292
+ enableSubmodule: false
293
+ enableGitLfs: false
294
+
295
+ - name: qemu
296
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
297
+ run: |
298
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
299
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
300
+ apt-get update
301
+ apt-get build-dep -y qemu
302
+ cd qemu
303
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=arm-linux-user --disable-system
304
+ make -j$(nproc)
305
+ make install
306
+
307
+ - name: build
308
+ run: |
309
+ mkdir build && cd build
310
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_GNU_INLINE_ASM=${{matrix.GNU_INLINE_ASM}} -DNCNN_VFPV4=ON -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
311
+ cmake --build . -j $(nproc)
312
+ - name: test
313
+ run: |
314
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
315
+ cd build
316
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j $(nproc)
317
+ - name: lcov-collect
318
+ run: |
319
+ cd build
320
+ lcov -d ./src -c -o lcov.info
321
+ lcov -r lcov.info '/usr/*' -o lcov.info
322
+ lcov -r lcov.info '*/build/*' -o lcov.info
323
+ lcov --list lcov.info
324
+
325
+ - name: build-armhf-vfpv3-d16
326
+ run: |
327
+ mkdir build-armhf-vfpv3-d16 && cd build-armhf-vfpv3-d16
328
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_GNU_INLINE_ASM=${{matrix.GNU_INLINE_ASM}} -DNCNN_VFPV4=OFF -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
329
+ cmake --build . -j $(nproc)
330
+ - name: test-armhf-vfpv3-d16
331
+ run: |
332
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
333
+ cd build-armhf-vfpv3-d16
334
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j $(nproc)
335
+ - name: lcov-collect-armhf-vfpv3-d16
336
+ run: |
337
+ cd build-armhf-vfpv3-d16
338
+ lcov -d ./src -c -o lcov.info
339
+ lcov -r lcov.info '/usr/*' -o lcov.info
340
+ lcov -r lcov.info '*/build-armhf-vfpv3-d16/*' -o lcov.info
341
+ lcov --list lcov.info
342
+
343
+ - name: codecov
344
+ run: |
345
+ ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
346
+ ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build-armhf-vfpv3-d16/lcov.info
347
+
348
+ linux-gcc-aarch64:
349
+ name: linux-gcc-aarch64
350
+ strategy:
351
+ matrix:
352
+ # openmp: ['OFF', 'ON']
353
+ include:
354
+ - { GNU_INLINE_ASM: 'ON', ARM82: 'OFF', ARM82DOT: 'OFF', ARM82FP16FML: 'OFF', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'}
355
+ - { GNU_INLINE_ASM: 'ON', ARM82: 'ON', ARM82DOT: 'OFF', ARM82FP16FML: 'OFF', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'}
356
+ - { GNU_INLINE_ASM: 'ON', ARM82: 'ON', ARM82DOT: 'ON', ARM82FP16FML: 'ON', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'}
357
+ - { GNU_INLINE_ASM: 'ON', ARM82: 'ON', ARM82DOT: 'ON', ARM82FP16FML: 'ON', ARM84BF16: 'ON', ARM84I8MM: 'ON', ARM86SVE: 'OFF'}
358
+ - { GNU_INLINE_ASM: 'OFF', ARM82: 'ON', ARM82DOT: 'ON', ARM82FP16FML: 'ON', ARM84BF16: 'ON', ARM84I8MM: 'ON', ARM86SVE: 'OFF'}
359
+
360
+ runs-on:
361
+ pool-name: docker
362
+ container:
363
+ image: bkci/ci:ubuntu
364
+ steps:
365
+ - name: checkout
366
+ checkout: self
367
+ with:
368
+ strategy: FRESH_CHECKOUT
369
+ enableSubmodule: false
370
+ enableGitLfs: false
371
+
372
+ - name: install-deps
373
+ run: |
374
+ apt-get update
375
+ apt-get install -y lcov g++-aarch64-linux-gnu libcapstone4 libglib2.0-0
376
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
377
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
378
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
379
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
380
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
381
+ shasum -a 256 -c codecov.SHA256SUM
382
+ chmod +x codecov
383
+
384
+ - name: cache-qemu
385
+ id: cache-qemu
386
+ uses: cache@1.*
387
+ with:
388
+ cachePaths: qemu-install
389
+ cacheKey: qemu-aarch64-install-20220831-1
390
+
391
+ - name: checkout-qemu
392
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
393
+ checkout: https://github.com/qemu/qemu.git
394
+ with:
395
+ pullType: COMMIT_ID
396
+ refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
397
+ localPath: qemu
398
+ enableSubmodule: false
399
+ enableGitLfs: false
400
+
401
+ - name: qemu
402
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
403
+ run: |
404
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
405
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
406
+ apt-get update
407
+ apt-get build-dep -y qemu
408
+ cd qemu
409
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=aarch64-linux-user --disable-system
410
+ make -j$(nproc)
411
+ make install
412
+
413
+ - name: build
414
+ run: |
415
+ mkdir build && cd build
416
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake \
417
+ -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON \
418
+ -DNCNN_GNU_INLINE_ASM=${{matrix.GNU_INLINE_ASM}} \
419
+ -DNCNN_ARM82=${{matrix.ARM82}} \
420
+ -DNCNN_ARM82DOT=${{matrix.ARM82DOT}} \
421
+ -DNCNN_ARM82FP16FML=${{matrix.ARM82FP16FML}} \
422
+ -DNCNN_ARM84BF16=${{matrix.ARM84BF16}} \
423
+ -DNCNN_ARM84I8MM=${{matrix.ARM84I8MM}} \
424
+ ..
425
+ cmake --build . -j $(nproc)
426
+ - name: test
427
+ run: |
428
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
429
+ cd build
430
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
431
+ - name: lcov-collect
432
+ run: |
433
+ cd build
434
+ lcov -d ./src -c -o lcov.info
435
+ lcov -r lcov.info '/usr/*' -o lcov.info
436
+ lcov -r lcov.info '*/build/*' -o lcov.info
437
+ lcov --list lcov.info
438
+ - name: codecov
439
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
440
+
441
+ linux-gcc-mipsisa32r6el:
442
+ name: linux-gcc-mipsisa32r6el
443
+ strategy:
444
+ matrix:
445
+ OPENMP: ['OFF', 'ON']
446
+
447
+ runs-on:
448
+ pool-name: docker
449
+ container:
450
+ image: bkci/ci:ubuntu
451
+ steps:
452
+ - name: checkout
453
+ checkout: self
454
+ with:
455
+ strategy: FRESH_CHECKOUT
456
+ enableSubmodule: false
457
+ enableGitLfs: false
458
+
459
+ - name: install-deps
460
+ run: |
461
+ apt-get update
462
+ apt-get install -y lcov g++-mipsisa32r6el-linux-gnu libcapstone4 libglib2.0-0
463
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
464
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
465
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
466
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
467
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
468
+ shasum -a 256 -c codecov.SHA256SUM
469
+ chmod +x codecov
470
+
471
+ - name: cache-qemu
472
+ id: cache-qemu
473
+ uses: cache@1.*
474
+ with:
475
+ cachePaths: qemu-install
476
+ cacheKey: qemu-mipsel-install-20220831-1
477
+
478
+ - name: checkout-qemu
479
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
480
+ checkout: https://github.com/qemu/qemu.git
481
+ with:
482
+ pullType: COMMIT_ID
483
+ refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
484
+ localPath: qemu
485
+ enableSubmodule: false
486
+ enableGitLfs: false
487
+
488
+ - name: qemu
489
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
490
+ run: |
491
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
492
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
493
+ apt-get update
494
+ apt-get build-dep -y qemu
495
+ cd qemu
496
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=mipsel-linux-user --disable-system
497
+ make -j$(nproc)
498
+ make install
499
+
500
+ - name: build
501
+ run: |
502
+ mkdir build && cd build
503
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=OFF -DNCNN_MMI=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
504
+ cmake --build . -j $(nproc)
505
+ - name: test
506
+ run: |
507
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
508
+ cd build
509
+ TESTS_EXECUTABLE_LOADER=qemu-mipsel TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa32r6el-linux-gnu" ctest --output-on-failure -j $(nproc)
510
+ - name: lcov-collect
511
+ run: |
512
+ cd build
513
+ lcov -d ./src -c -o lcov.info
514
+ lcov -r lcov.info '/usr/*' -o lcov.info
515
+ lcov -r lcov.info '*/build/*' -o lcov.info
516
+ lcov --list lcov.info
517
+ - name: codecov
518
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
519
+
520
+ linux-gcc-mipsisa64r6el:
521
+ name: linux-gcc-mipsisa64r6el
522
+ strategy:
523
+ matrix:
524
+ OPENMP: ['OFF', 'ON']
525
+
526
+ runs-on:
527
+ pool-name: docker
528
+ container:
529
+ image: bkci/ci:ubuntu
530
+ steps:
531
+ - name: checkout
532
+ checkout: self
533
+ with:
534
+ strategy: FRESH_CHECKOUT
535
+ enableSubmodule: false
536
+ enableGitLfs: false
537
+
538
+ - name: install-deps
539
+ run: |
540
+ apt-get update
541
+ apt-get install -y lcov g++-mipsisa64r6el-linux-gnuabi64 libcapstone4 libglib2.0-0
542
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
543
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
544
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
545
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
546
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
547
+ shasum -a 256 -c codecov.SHA256SUM
548
+ chmod +x codecov
549
+
550
+ - name: cache-qemu
551
+ id: cache-qemu
552
+ uses: cache@1.*
553
+ with:
554
+ cachePaths: qemu-install
555
+ cacheKey: qemu-mips64el-install-20220831-1
556
+
557
+ - name: checkout-qemu
558
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
559
+ checkout: https://github.com/qemu/qemu.git
560
+ with:
561
+ pullType: COMMIT_ID
562
+ refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
563
+ localPath: qemu
564
+ enableSubmodule: false
565
+ enableGitLfs: false
566
+
567
+ - name: qemu
568
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
569
+ run: |
570
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
571
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
572
+ apt-get update
573
+ apt-get build-dep -y qemu
574
+ cd qemu
575
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=mips64el-linux-user --disable-system
576
+ make -j$(nproc)
577
+ make install
578
+
579
+ - name: build
580
+ run: |
581
+ mkdir build && cd build
582
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=ON -DNCNN_MMI=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
583
+ cmake --build . -j $(nproc)
584
+ - name: test
585
+ run: |
586
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
587
+ cd build
588
+ TESTS_EXECUTABLE_LOADER=qemu-mips64el TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa64r6el-linux-gnuabi64" ctest --output-on-failure -j $(nproc)
589
+ - name: lcov-collect
590
+ run: |
591
+ cd build
592
+ lcov -d ./src -c -o lcov.info
593
+ lcov -r lcov.info '/usr/*' -o lcov.info
594
+ lcov -r lcov.info '*/build/*' -o lcov.info
595
+ lcov --list lcov.info
596
+ - name: codecov
597
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
598
+
599
+ linux-gcc-riscv64:
600
+ name: linux-gcc-riscv64
601
+ strategy:
602
+ matrix:
603
+ OPENMP: ['OFF', 'ON']
604
+
605
+ runs-on:
606
+ pool-name: docker
607
+ container:
608
+ image: bkci/ci:ubuntu
609
+ steps:
610
+ - name: checkout
611
+ checkout: self
612
+ with:
613
+ strategy: FRESH_CHECKOUT
614
+ enableSubmodule: false
615
+ enableGitLfs: false
616
+
617
+ - name: install-deps
618
+ run: |
619
+ apt-get update
620
+ apt-get install -y lcov g++-riscv64-linux-gnu libcapstone4 libglib2.0-0
621
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
622
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
623
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
624
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
625
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
626
+ shasum -a 256 -c codecov.SHA256SUM
627
+ chmod +x codecov
628
+
629
+ - name: cache-qemu
630
+ id: cache-qemu
631
+ uses: cache@1.*
632
+ with:
633
+ cachePaths: qemu-install
634
+ cacheKey: qemu-riscv64-install-20230624-1
635
+
636
+ - name: checkout-qemu
637
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
638
+ checkout: https://github.com/qemu/qemu.git
639
+ with:
640
+ pullType: COMMIT_ID
641
+ refName: b455ce4c2f300c8ba47cba7232dd03261368a4cb
642
+ localPath: qemu
643
+ enableSubmodule: false
644
+ enableGitLfs: false
645
+
646
+ - name: qemu
647
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
648
+ run: |
649
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
650
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
651
+ apt-get update
652
+ apt-get build-dep -y qemu
653
+ apt-get install -y python3-pip
654
+ python3 -m pip install --upgrade pip
655
+ apt-get remove -y python3-setuptools
656
+ pip3 install -U setuptools
657
+ cd qemu
658
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
659
+ patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
660
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=riscv64-linux-user --disable-system
661
+ make -j$(nproc)
662
+ make install
663
+
664
+ - name: build
665
+ run: |
666
+ mkdir build && cd build
667
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
668
+ cmake --build . -j $(nproc)
669
+ - name: test
670
+ run: |
671
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
672
+ cd build
673
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j $(nproc)
674
+ - name: lcov-collect
675
+ run: |
676
+ cd build
677
+ lcov -d ./src -c -o lcov.info
678
+ lcov -r lcov.info '/usr/*' -o lcov.info
679
+ lcov -r lcov.info '*/build/*' -o lcov.info
680
+ lcov --list lcov.info
681
+ - name: codecov
682
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
683
+
684
+ linux-gcc-riscv64-rvv:
685
+ name: linux-gcc-riscv64-rvv
686
+ strategy:
687
+ matrix:
688
+ OPENMP: ['OFF', 'ON']
689
+
690
+ runs-on:
691
+ pool-name: docker
692
+ container:
693
+ image: bkci/ci:ubuntu
694
+ steps:
695
+ - name: checkout
696
+ checkout: self
697
+ with:
698
+ strategy: FRESH_CHECKOUT
699
+ enableSubmodule: false
700
+ enableGitLfs: false
701
+
702
+ - name: install-deps
703
+ run: |
704
+ apt-get update
705
+ apt-get install -y lcov libcapstone4 libglib2.0-0
706
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
707
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
708
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
709
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
710
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
711
+ shasum -a 256 -c codecov.SHA256SUM
712
+ chmod +x codecov
713
+
714
+ - name: cache-qemu
715
+ id: cache-qemu
716
+ uses: cache@1.*
717
+ with:
718
+ cachePaths: qemu-install
719
+ cacheKey: qemu-riscv64-install-20230624-1
720
+
721
+ - name: checkout-qemu
722
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
723
+ checkout: https://github.com/qemu/qemu.git
724
+ with:
725
+ pullType: COMMIT_ID
726
+ refName: b455ce4c2f300c8ba47cba7232dd03261368a4cb
727
+ localPath: qemu
728
+ enableSubmodule: false
729
+ enableGitLfs: false
730
+
731
+ - name: qemu
732
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
733
+ run: |
734
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
735
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
736
+ apt-get update
737
+ apt-get build-dep -y qemu
738
+ apt-get install -y python3-pip
739
+ python3 -m pip install --upgrade pip
740
+ apt-get remove -y python3-setuptools
741
+ pip3 install -U setuptools
742
+ cd qemu
743
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
744
+ patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
745
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=riscv64-linux-user --disable-system
746
+ make -j$(nproc)
747
+ make install
748
+
749
+ - name: cache-rv64gcv
750
+ id: cache-rv64gcv
751
+ uses: cache@1.*
752
+ with:
753
+ cachePaths: rv64gcv-install
754
+ cacheKey: rv64gcv-linux-install-20221029-1
755
+
756
+ - name: checkout-riscv-gnu-toolchain
757
+ if: steps.cache-rv64gcv.outputs.cacheHit != 'true'
758
+ checkout: https://github.com/riscv/riscv-gnu-toolchain.git
759
+ with:
760
+ pullType: COMMIT_ID
761
+ refName: da01ba455ce3802ffa84fdca3a089079996dbfc3
762
+ localPath: riscv-gnu-toolchain
763
+ enableSubmodule: false
764
+ enableGitLfs: false
765
+
766
+ - name: riscv-gnu-toolchain
767
+ if: steps.cache-rv64gcv.outputs.cacheHit != 'true'
768
+ run: |
769
+ apt-get update
770
+ apt-get install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
771
+ cd riscv-gnu-toolchain
772
+ git submodule update --init --recursive --depth 1 glibc
773
+ git submodule update --init --recursive --depth 1 newlib
774
+ #git submodule update --init --recursive --depth 1 riscv-binutils
775
+ #git submodule update --init --recursive --depth 1 riscv-gcc
776
+ git submodule update --init --recursive --depth 1 riscv-dejagnu
777
+ git submodule update --init --recursive --depth 1 riscv-gdb
778
+ rm -rf riscv-binutils
779
+ git clone -b binutils-2_39-branch https://sourceware.org/git/binutils-gdb.git riscv-binutils
780
+ rm -rf riscv-gcc
781
+ git clone -b riscv-gcc-rvv-next https://github.com/riscv-collab/riscv-gcc.git riscv-gcc
782
+ cd riscv-gcc
783
+ git checkout 8a0c1b106f01c455a8fb478cfe52d859a69020fd
784
+ cd ..
785
+ sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c
786
+ ./configure --prefix=${{ci.workspace}}/rv64gcv-install --with-arch=rv64gcv_zfh
787
+ make linux -j$(nproc)
788
+ find ${{ci.workspace}}/rv64gcv-install -type f | xargs -i strip -g {} || true
789
+
790
+ - name: build
791
+ run: |
792
+ export RISCV_ROOT_PATH=${{ci.workspace}}/rv64gcv-install
793
+ mkdir build && cd build
794
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_FLAGS="-O1" -DCMAKE_CXX_FLAGS="-O1" -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
795
+ cmake --build . -j $(nproc)
796
+ - name: test-vlen128
797
+ run: |
798
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
799
+ cd build
800
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,x-zvfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;${{ci.workspace}}/rv64gcv-install/sysroot" ctest --output-on-failure -j $(nproc)
801
+ - name: lcov-collect-vlen128
802
+ run: |
803
+ cd build
804
+ lcov --gcov-tool ${{ci.workspace}}/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info
805
+ lcov -r lcov.info '/usr/*' -o lcov.info
806
+ lcov -r lcov.info '*/build/*' -o lcov.info
807
+ lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info
808
+ lcov --list lcov.info
809
+ - name: codecov-vlen128
810
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
811
+ - name: test-vlen256
812
+ run: |
813
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
814
+ cd build
815
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,x-zvfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;${{ci.workspace}}/rv64gcv-install/sysroot" ctest --output-on-failure -j $(nproc)
816
+ - name: lcov-collect-vlen256
817
+ run: |
818
+ cd build
819
+ lcov --gcov-tool ${{ci.workspace}}/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info
820
+ lcov -r lcov.info '/usr/*' -o lcov.info
821
+ lcov -r lcov.info '*/build/*' -o lcov.info
822
+ lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info
823
+ lcov --list lcov.info
824
+ - name: codecov-vlen256
825
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
826
+
827
+ linux-gcc-loongarch64:
828
+ name: linux-gcc-loongarch64
829
+ strategy:
830
+ matrix:
831
+ OPENMP: ['OFF', 'ON']
832
+
833
+ runs-on:
834
+ pool-name: docker
835
+ container:
836
+ image: bkci/ci:ubuntu
837
+ steps:
838
+ - name: checkout
839
+ checkout: self
840
+ with:
841
+ strategy: FRESH_CHECKOUT
842
+ enableSubmodule: false
843
+ enableGitLfs: false
844
+
845
+ - name: install-deps
846
+ run: |
847
+ apt-get update
848
+ apt-get install -y lcov libcapstone4 libglib2.0-0 python3-venv
849
+ curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
850
+ curl -Os https://uploader.codecov.io/latest/linux/codecov
851
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
852
+ curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
853
+ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
854
+ shasum -a 256 -c codecov.SHA256SUM
855
+ chmod +x codecov
856
+ wget https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/download/8.0/loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz
857
+ tar -xf loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz
858
+
859
+ - name: cache-qemu
860
+ id: cache-qemu
861
+ uses: cache@1.*
862
+ with:
863
+ cachePaths: qemu-install
864
+ cacheKey: qemu-loongarch64-install-20230524-1
865
+
866
+ - name: checkout-qemu
867
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
868
+ checkout: https://github.com/qemu/qemu.git
869
+ with:
870
+ pullType: COMMIT_ID
871
+ refName: 1c12355b31046a6b35a4f50c85c4f01afb1bd728
872
+ localPath: qemu
873
+ enableSubmodule: false
874
+ enableGitLfs: false
875
+
876
+ - name: qemu
877
+ if: steps.cache-qemu.outputs.cacheHit != 'true'
878
+ run: |
879
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
880
+ echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
881
+ apt-get update
882
+ apt-get build-dep -y qemu
883
+ cd qemu
884
+ wget https://github.com/nihui/ncnn-assets/raw/master/qemu-patches/0001-linux-user-Expose-loongarch-lsx-isa-bit-in-get_elf_hwcap.patch
885
+ patch -p1 -i 0001-linux-user-Expose-loongarch-lsx-isa-bit-in-get_elf_hwcap.patch
886
+ ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=loongarch64-linux-user --disable-system
887
+ make -j$(nproc)
888
+ make install
889
+
890
+ - name: build
891
+ run: |
892
+ export LOONGARCH64_ROOT_PATH=${{ci.workspace}}/cross-tools
893
+ mkdir build && cd build
894
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_LSX=ON -DNCNN_LASX=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
895
+ cmake --build . -j $(nproc)
896
+ - name: test
897
+ run: |
898
+ export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
899
+ cd build
900
+ TESTS_EXECUTABLE_LOADER=qemu-loongarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;${{ci.workspace}}/cross-tools/target" ctest --output-on-failure -j $(nproc)
901
+ - name: lcov-collect
902
+ run: |
903
+ cd build
904
+ lcov --gcov-tool ${{ci.workspace}}/cross-tools/bin/loongarch64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info
905
+ lcov -r lcov.info '/usr/*' -o lcov.info
906
+ lcov -r lcov.info '*/build/*' -o lcov.info
907
+ lcov -r lcov.info '*/cross-tools/*' -o lcov.info
908
+ lcov --list lcov.info
909
+ - name: codecov
910
+ run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
.clang-format ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # find src/ tools/ tests/ examples/ benchmark/ -type f -name '*.c' -o -name '*.cpp' -o -name '*.h' | xargs -i clang-format -i {}
2
+
3
+ # need clang-format >= 10.0
4
+
5
+ AccessModifierOffset: -4
6
+ AlignAfterOpenBracket: Align
7
+ AlignConsecutiveAssignments: false
8
+ # AlignConsecutiveBitFields: true
9
+ AlignConsecutiveDeclarations: false
10
+ AlignConsecutiveMacros: true
11
+ AlignEscapedNewlines: Left
12
+ # AlignOperands: AlignAfterOperator
13
+ AlignTrailingComments: true
14
+ AllowAllArgumentsOnNextLine: true
15
+ AllowAllConstructorInitializersOnNextLine: true
16
+ AllowAllParametersOfDeclarationOnNextLine: true
17
+ AllowShortBlocksOnASingleLine: Always
18
+ AllowShortCaseLabelsOnASingleLine: true
19
+ # AllowShortEnumsOnASingleLine: true
20
+ AllowShortFunctionsOnASingleLine: None
21
+ AllowShortIfStatementsOnASingleLine: WithoutElse
22
+ AllowShortLambdasOnASingleLine: All
23
+ AllowShortLoopsOnASingleLine: true
24
+ AlwaysBreakAfterReturnType: None
25
+ AlwaysBreakBeforeMultilineStrings: false
26
+ AlwaysBreakTemplateDeclarations: Yes
27
+ BinPackArguments: true
28
+ BinPackParameters: true
29
+ BraceWrapping:
30
+ AfterCaseLabel: true
31
+ AfterClass: true
32
+ AfterControlStatement: Always
33
+ AfterEnum: true
34
+ AfterFunction: true
35
+ AfterNamespace: false
36
+ AfterObjCDeclaration: false
37
+ AfterStruct: true
38
+ AfterUnion: true
39
+ AfterExternBlock: false
40
+ BeforeCatch: true
41
+ BeforeElse: true
42
+ # BeforeLambdaBody: false
43
+ # BeforeWhile: false
44
+ IndentBraces: false
45
+ SplitEmptyFunction: true
46
+ SplitEmptyRecord: true
47
+ SplitEmptyNamespace: false
48
+ BreakAfterJavaFieldAnnotations: true
49
+ BreakBeforeBinaryOperators: All
50
+ BreakBeforeBraces: Custom
51
+ BreakBeforeTernaryOperators: true
52
+ BreakConstructorInitializers: BeforeColon
53
+ BreakInheritanceList: BeforeColon
54
+ BreakStringLiterals: false
55
+ ColumnLimit: 0
56
+ # CommentPragmas:
57
+ CompactNamespaces: false
58
+ ConstructorInitializerAllOnOneLineOrOnePerLine: true
59
+ ConstructorInitializerIndentWidth: 4
60
+ ContinuationIndentWidth: 4
61
+ Cpp11BracedListStyle: true
62
+ DeriveLineEnding: false
63
+ DerivePointerAlignment: false
64
+ # DisableFormat:
65
+ # ExperimentalAutoDetectBinPacking:
66
+ FixNamespaceComments: true
67
+ # ForEachMacros:
68
+ IncludeBlocks: Regroup
69
+ # IncludeCategories:
70
+ # IncludeIsMainRegex:
71
+ # IncludeIsMainSourceRegex:
72
+ # IndentCaseBlocks: false
73
+ IndentCaseLabels: false
74
+ # IndentExternBlock: NoIndent
75
+ IndentGotoLabels: false
76
+ IndentPPDirectives: None
77
+ IndentWidth: 4
78
+ # IndentWrappedFunctionNames: 4
79
+ # InsertTrailingCommas: None
80
+ # JavaImportGroups:
81
+ # JavaScriptQuotes
82
+ # JavaScriptWrapImports:
83
+ KeepEmptyLinesAtTheStartOfBlocks: false
84
+ Language: Cpp
85
+ # MacroBlockBegin:
86
+ # MacroBlockEnd:
87
+ MaxEmptyLinesToKeep: 1
88
+ NamespaceIndentation: None
89
+ # NamespaceMacros:
90
+ # ObjCBinPackProtocolList:
91
+ # ObjCBlockIndentWidth:
92
+ # ObjCBreakBeforeNestedBlockParam:
93
+ # ObjCSpaceAfterProperty:
94
+ # ObjCSpaceBeforeProtocolList:
95
+ # PenaltyBreakAssignment:
96
+ # PenaltyBreakBeforeFirstCallParameter:
97
+ # PenaltyBreakComment:
98
+ # PenaltyBreakFirstLessLess:
99
+ # PenaltyBreakString:
100
+ # PenaltyBreakTemplateDeclaration:
101
+ # PenaltyExcessCharacter:
102
+ # PenaltyReturnTypeOnItsOwnLine:
103
+ PointerAlignment: Left
104
+ # RawStringFormats:
105
+ ReflowComments: false
106
+ SortIncludes: false
107
+ SortUsingDeclarations: true
108
+ SpaceAfterCStyleCast: false
109
+ SpaceAfterLogicalNot: false
110
+ SpaceAfterTemplateKeyword: false
111
+ SpaceBeforeAssignmentOperators: true
112
+ SpaceBeforeCpp11BracedList: false
113
+ SpaceBeforeCtorInitializerColon: true
114
+ SpaceBeforeInheritanceColon: true
115
+ SpaceBeforeParens: ControlStatements
116
+ SpaceBeforeRangeBasedForLoopColon: true
117
+ SpaceBeforeSquareBrackets: false
118
+ SpaceInEmptyBlock: false
119
+ SpaceInEmptyParentheses: false
120
+ SpacesBeforeTrailingComments: 1
121
+ SpacesInAngles: false
122
+ SpacesInCStyleCastParentheses: false
123
+ SpacesInConditionalStatement: false
124
+ SpacesInContainerLiterals: false
125
+ SpacesInParentheses: false
126
+ SpacesInSquareBrackets: false
127
+ Standard: c++03
128
+ #StatementMacros:
129
+ TabWidth: 4
130
+ # TypenameMacros:
131
+ UseCRLF: false
132
+ UseTab: Never
.gitattributes CHANGED
@@ -1,35 +1,47 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.comp linguist-language=GLSL
2
+ build/CMakeFiles/3.27.4/CMakeDetermineCompilerABI_C.bin filter=lfs diff=lfs merge=lfs -text
3
+ build/CMakeFiles/3.27.4/CMakeDetermineCompilerABI_CXX.bin filter=lfs diff=lfs merge=lfs -text
4
+ build/benchmark/benchncnn filter=lfs diff=lfs merge=lfs -text
5
+ build/examples/fasterrcnn filter=lfs diff=lfs merge=lfs -text
6
+ build/examples/mobilenetssd filter=lfs diff=lfs merge=lfs -text
7
+ build/examples/mobilenetv2ssdlite filter=lfs diff=lfs merge=lfs -text
8
+ build/examples/nanodet filter=lfs diff=lfs merge=lfs -text
9
+ build/examples/nanodetplus_pnnx filter=lfs diff=lfs merge=lfs -text
10
+ build/examples/p2pnet filter=lfs diff=lfs merge=lfs -text
11
+ build/examples/peleenetssd_seg filter=lfs diff=lfs merge=lfs -text
12
+ build/examples/retinaface filter=lfs diff=lfs merge=lfs -text
13
+ build/examples/rfcn filter=lfs diff=lfs merge=lfs -text
14
+ build/examples/rvm filter=lfs diff=lfs merge=lfs -text
15
+ build/examples/scrfd filter=lfs diff=lfs merge=lfs -text
16
+ build/examples/scrfd_crowdhuman filter=lfs diff=lfs merge=lfs -text
17
+ build/examples/shufflenetv2 filter=lfs diff=lfs merge=lfs -text
18
+ build/examples/simplepose filter=lfs diff=lfs merge=lfs -text
19
+ build/examples/squeezenet filter=lfs diff=lfs merge=lfs -text
20
+ build/examples/squeezenet_c_api filter=lfs diff=lfs merge=lfs -text
21
+ build/examples/squeezenetssd filter=lfs diff=lfs merge=lfs -text
22
+ build/examples/yolact filter=lfs diff=lfs merge=lfs -text
23
+ build/examples/yolov2 filter=lfs diff=lfs merge=lfs -text
24
+ build/examples/yolov3 filter=lfs diff=lfs merge=lfs -text
25
+ build/examples/yolov4 filter=lfs diff=lfs merge=lfs -text
26
+ build/examples/yolov5 filter=lfs diff=lfs merge=lfs -text
27
+ build/examples/yolov5_pnnx filter=lfs diff=lfs merge=lfs -text
28
+ build/examples/yolov7 filter=lfs diff=lfs merge=lfs -text
29
+ build/examples/yolov7_pnnx filter=lfs diff=lfs merge=lfs -text
30
+ build/examples/yolox filter=lfs diff=lfs merge=lfs -text
31
+ build/install/bin/caffe2ncnn filter=lfs diff=lfs merge=lfs -text
32
+ build/install/bin/ncnn2int8 filter=lfs diff=lfs merge=lfs -text
33
+ build/install/bin/ncnn2mem filter=lfs diff=lfs merge=lfs -text
34
+ build/install/bin/ncnn2table filter=lfs diff=lfs merge=lfs -text
35
+ build/install/bin/ncnnoptimize filter=lfs diff=lfs merge=lfs -text
36
+ build/install/lib/libncnn.a filter=lfs diff=lfs merge=lfs -text
37
+ build/src/CMakeFiles/ncnn.dir/layer.cpp.o filter=lfs diff=lfs merge=lfs -text
38
+ build/src/libncnn.a filter=lfs diff=lfs merge=lfs -text
39
+ build/tools/caffe/CMakeFiles/caffe2ncnn.dir/caffe.pb.cc.o filter=lfs diff=lfs merge=lfs -text
40
+ build/tools/caffe/caffe2ncnn filter=lfs diff=lfs merge=lfs -text
41
+ build/tools/ncnn2mem filter=lfs diff=lfs merge=lfs -text
42
+ build/tools/ncnnoptimize filter=lfs diff=lfs merge=lfs -text
43
+ build/tools/quantize/ncnn2int8 filter=lfs diff=lfs merge=lfs -text
44
+ build/tools/quantize/ncnn2table filter=lfs diff=lfs merge=lfs -text
45
+ examples/squeezenet_v1.1.bin filter=lfs diff=lfs merge=lfs -text
46
+ examples/squeezenet_v1.1.caffemodel filter=lfs diff=lfs merge=lfs -text
47
+ examples/squeezenet_v1.1.param.bin filter=lfs diff=lfs merge=lfs -text
.github/ISSUE_TEMPLATE/bug.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F41B bug issue"
3
+ about: submit a bug report +_+
4
+ ---
5
+
6
+ ## error log | 日志或报错信息 | ログ
7
+
8
+ ## context | 编译/运行环境 | バックグラウンド
9
+
10
+ ## how to reproduce | 复现步骤 | 再現方法
11
+ 1.
12
+ 2.
13
+ 3.
14
+
15
+ ## more | 其他 | その他
.github/ISSUE_TEMPLATE/model-convert.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F6B8 model convert issue"
3
+ about: "Life is Short, Use pnnx and convertmodel.com"
4
+ ---
5
+
6
+ ## error log | 日志或报错信息 | ログ
7
+
8
+ ## model | 模型 | モデル
9
+ 1. original model
10
+
11
+ ## how to reproduce | 复现步骤 | 再現方法
12
+ 1.
13
+ 2.
14
+ 3.
.github/ISSUE_TEMPLATE/others.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F4DD others"
3
+ about: discussion, suggestion and question
4
+ ---
5
+
6
+ ## detail | 详细描述 | 詳細な説明
.github/ISSUE_TEMPLATE/quantization.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F4C8 quantization"
3
+ about: best wishes for your low bit quantization has a low accuracy loss...\(^▽^)/...2333...
4
+ ---
5
+
6
+ ## expectation | 诉求 | 期待する
7
+ 1. speed
8
+ 2. precision
9
+
10
+ ## model | 模型 | モデル
11
+ 1. model.param and model.bin
12
+
13
+ ## detail | 详细描述 | 詳細な説明
.github/dependabot.yml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "daily"
.github/workflows/android-armv7-cpu.yml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-armv7-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-armv7-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ pull_request:
13
+ branches: [master]
14
+ paths:
15
+ - '.github/workflows/android-armv7-cpu.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/*'
19
+ - 'src/layer/*'
20
+ - 'src/layer/arm/**'
21
+ concurrency:
22
+ group: android-armv7-cpu-${{ github.ref }}
23
+ cancel-in-progress: true
24
+ permissions:
25
+ contents: read
26
+
27
+ jobs:
28
+ android-armv7:
29
+ runs-on: ubuntu-20.04
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: build
33
+ run: |
34
+ mkdir build && cd build
35
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 ..
36
+ cmake --build . -j 2
37
+ - name: build-shared
38
+ run: |
39
+ mkdir build-shared && cd build-shared
40
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
41
+ cmake --build . -j 2
42
+
43
+ - name: ndk-r16b
44
+ run: |
45
+ wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip -O $GITHUB_WORKSPACE/android-ndk-r16b-linux-x86_64.zip
46
+ cd $GITHUB_WORKSPACE && unzip -q android-ndk-r16b-linux-x86_64.zip
47
+ - name: build-noneon
48
+ run: |
49
+ mkdir build-noneon && cd build-noneon
50
+ cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DANDROID_PLATFORM=android-14 ..
51
+ cmake --build . -j 2
52
+ - name: build-noneon-shared
53
+ run: |
54
+ mkdir build-noneon-shared && cd build-noneon-shared
55
+ cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
56
+ cmake --build . -j 2
.github/workflows/android-armv7-gpu.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-armv7-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-armv7-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ - 'src/layer/vulkan/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/android-armv7-gpu.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/arm/**'
22
+ - 'src/layer/vulkan/**'
23
+ concurrency:
24
+ group: android-armv7-gpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ android-armv7-gpu:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ submodules: true
36
+ - name: build
37
+ run: |
38
+ mkdir build && cd build
39
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON ..
40
+ cmake --build . -j 2
41
+ - name: build-shared
42
+ run: |
43
+ mkdir build-shared && cd build-shared
44
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
45
+ cmake --build . -j 2
.github/workflows/android-armv8-cpu.yml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-armv8-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-armv8-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ pull_request:
13
+ branches: [master]
14
+ paths:
15
+ - '.github/workflows/android-armv8-cpu.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/*'
19
+ - 'src/layer/*'
20
+ - 'src/layer/arm/**'
21
+ concurrency:
22
+ group: android-armv8-cpu-${{ github.ref }}
23
+ cancel-in-progress: true
24
+ permissions:
25
+ contents: read
26
+
27
+ jobs:
28
+ android-aarch64:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: build
33
+ run: |
34
+ mkdir build && cd build
35
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
36
+ cmake --build . -j 2
37
+ - name: build-shared
38
+ run: |
39
+ mkdir build-shared && cd build-shared
40
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_SHARED_LIB=ON ..
41
+ cmake --build . -j 2
.github/workflows/android-armv8-gpu.yml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-armv8-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-armv8-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ - 'src/layer/vulkan/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/android-armv8-gpu.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/arm/**'
22
+ - 'src/layer/vulkan/**'
23
+ concurrency:
24
+ group: android-armv8-gpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ android-aarch64-gpu:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ submodules: true
36
+ - name: build
37
+ run: |
38
+ mkdir build && cd build
39
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON ..
40
+ cmake --build . -j 2
41
+ - name: build-shared
42
+ run: |
43
+ mkdir build-shared && cd build-shared
44
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
45
+ cmake --build . -j 2
46
+ - name: build-termux
47
+ run: |
48
+ mkdir build-termux && cd build-termux
49
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_PLATFORM_API=OFF ..
50
+ cmake --build . -j 2
51
+ - name: build-android-29
52
+ run: |
53
+ mkdir build-android-29 && cd build-android-29
54
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-29 -DNCNN_VULKAN=ON ..
55
+ cmake --build . -j 2
56
+ - name: build-android-29-shared
57
+ run: |
58
+ mkdir build-android-29-shared && cd build-android-29-shared
59
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-29 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
60
+ cmake --build . -j 2
61
+
62
+ android-aarch64-gpu-ndk-r16b:
63
+ runs-on: ubuntu-20.04
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ with:
67
+ submodules: true
68
+ - name: ndk-r16b
69
+ run: |
70
+ wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip -O $GITHUB_WORKSPACE/android-ndk-r16b-linux-x86_64.zip
71
+ cd $GITHUB_WORKSPACE && unzip -q android-ndk-r16b-linux-x86_64.zip
72
+ - name: configure
73
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON ..
74
+ - name: build
75
+ run: cmake --build build -j 2
.github/workflows/android-x64-cpu.yml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-x64-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-x64-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ pull_request:
13
+ branches: [master]
14
+ paths:
15
+ - '.github/workflows/android-x64-cpu.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/*'
19
+ - 'src/layer/*'
20
+ - 'src/layer/x86/**'
21
+ concurrency:
22
+ group: android-x64-cpu-${{ github.ref }}
23
+ cancel-in-progress: true
24
+ permissions:
25
+ contents: read
26
+
27
+ jobs:
28
+ android-x86_64:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: build
33
+ run: |
34
+ mkdir build && cd build
35
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 ..
36
+ cmake --build . -j 2
37
+ - name: build-shared
38
+ run: |
39
+ mkdir build-shared && cd build-shared
40
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 -DNCNN_SHARED_LIB=ON ..
41
+ cmake --build . -j 2
.github/workflows/android-x64-gpu.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-x64-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-x64-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/android-x64-gpu.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/x86/**'
22
+ - 'src/layer/vulkan/**'
23
+ concurrency:
24
+ group: android-x64-gpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ android-x86_64-gpu:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ submodules: true
36
+ - name: build
37
+ run: |
38
+ mkdir build && cd build
39
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON ..
40
+ cmake --build . -j 2
41
+ - name: build-shared
42
+ run: |
43
+ mkdir build-shared && cd build-shared
44
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
45
+ cmake --build . -j 2
.github/workflows/android-x86-cpu.yml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-x86-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-x86-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ pull_request:
13
+ branches: [master]
14
+ paths:
15
+ - '.github/workflows/android-x86-cpu.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/*'
19
+ - 'src/layer/*'
20
+ - 'src/layer/x86/**'
21
+ concurrency:
22
+ group: android-x86-cpu-${{ github.ref }}
23
+ cancel-in-progress: true
24
+ permissions:
25
+ contents: read
26
+
27
+ jobs:
28
+ android-x86:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: build
33
+ run: |
34
+ mkdir build && cd build
35
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-14 ..
36
+ cmake --build . -j 2
37
+ - name: build-shared
38
+ run: |
39
+ mkdir build-shared && cd build-shared
40
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON ..
41
+ cmake --build . -j 2
.github/workflows/android-x86-gpu.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: android-x86-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/android-x86-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/android-x86-gpu.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/x86/**'
22
+ - 'src/layer/vulkan/**'
23
+ concurrency:
24
+ group: android-x86-gpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ android-x86-gpu:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ submodules: true
36
+ - name: build
37
+ run: |
38
+ mkdir build && cd build
39
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON ..
40
+ cmake --build . -j 2
41
+ - name: build-shared
42
+ run: |
43
+ mkdir build-shared && cd build-shared
44
+ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
45
+ cmake --build . -j 2
.github/workflows/code-format.yml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: code-format
2
+
3
+ on: [push, pull_request, pull_request_target]
4
+
5
+ concurrency:
6
+ group: code-format-${{ github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ code-format:
14
+ permissions:
15
+ contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
16
+ runs-on: ubuntu-20.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: cache-clang-format
21
+ id: cache-clang-format
22
+ uses: actions/cache@v3
23
+ with:
24
+ path: clang-format-install
25
+ key: clang-format-install-4
26
+ - name: clang-format
27
+ if: steps.cache-clang-format.outputs.cache-hit != 'true'
28
+ run: |
29
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz
30
+ tar -xf llvm-project-10.0.1.tar.xz
31
+ cd llvm-project-10.0.1
32
+ mkdir build
33
+ cd build
34
+ cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_DOCS=OFF ../llvm/
35
+ make -j2 clang-format
36
+ mkdir $GITHUB_WORKSPACE/clang-format-install
37
+ cp -r bin/clang-format $GITHUB_WORKSPACE/clang-format-install
38
+ cd ../../
39
+ rm -rf llvm-project-10.0.1
40
+ rm llvm-project-10.0.1.tar.xz
41
+
42
+ - name: astyle
43
+ run: |
44
+ sudo apt-get update
45
+ sudo apt-get install -y astyle
46
+
47
+ - name: code-format
48
+ run: |
49
+ mkdir -p ~/bin
50
+ mv $GITHUB_WORKSPACE/clang-format-install/clang-format ~/bin/clang-format
51
+ rm -rf $GITHUB_WORKSPACE/clang-format-install
52
+ export PATH=~/bin:$PATH
53
+ sh codeformat.sh
54
+ - uses: stefanzweifel/git-auto-commit-action@v4
55
+ with:
56
+ commit_message: apply code-format changes
57
+
58
+ - name: restore-clang-format-cache
59
+ run: |
60
+ mkdir $GITHUB_WORKSPACE/clang-format-install
61
+ cp -r ~/bin/clang-format $GITHUB_WORKSPACE/clang-format-install
.github/workflows/codeql-analysis.yml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ name: "CodeQL"
7
+
8
+ on:
9
+ push:
10
+ branches: [master]
11
+ paths-ignore: ['**.md']
12
+ pull_request:
13
+ # The branches below must be a subset of the branches above
14
+ branches: [master]
15
+ paths-ignore: ['**.md']
16
+ schedule:
17
+ - cron: '0 20 * * 4'
18
+
19
+ concurrency:
20
+ group: CodeQL-${{ github.ref }}
21
+ cancel-in-progress: true
22
+
23
+ permissions:
24
+ contents: read
25
+
26
+ jobs:
27
+ analyze:
28
+ permissions:
29
+ actions: read # for github/codeql-action/init to get workflow details
30
+ contents: read # for actions/checkout to fetch code
31
+ security-events: write # for github/codeql-action/autobuild to send a status report
32
+ name: Analyze
33
+ runs-on: ubuntu-latest
34
+
35
+ strategy:
36
+ fail-fast: false
37
+ matrix:
38
+ # Override automatic language detection by changing the below list
39
+ # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
40
+ language: ['cpp']
41
+ # Learn more...
42
+ # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
43
+
44
+ steps:
45
+ - name: Checkout repository
46
+ uses: actions/checkout@v4
47
+ with:
48
+ # We must fetch at least the immediate parents so that if this is
49
+ # a pull request then we can checkout the head.
50
+ fetch-depth: 2
51
+
52
+ # If this run was triggered by a pull request event, then checkout
53
+ # the head of the pull request instead of the merge commit.
54
+ - run: git checkout HEAD^2
55
+ if: ${{ github.event_name == 'pull_request' }}
56
+
57
+ # Initializes the CodeQL tools for scanning.
58
+ - name: Initialize CodeQL
59
+ uses: github/codeql-action/init@v2
60
+ with:
61
+ languages: ${{ matrix.language }}
62
+ # If you wish to specify custom queries, you can do so here or in a config file.
63
+ # By default, queries listed here will override any specified in a config file.
64
+ # Prefix the list here with "+" to use these queries and those in the config file.
65
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
66
+
67
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
68
+ # If this step fails, then you should remove it and run the build manually (see below)
69
+ - name: Autobuild
70
+ uses: github/codeql-action/autobuild@v2
71
+
72
+ # ℹ️ Command-line programs to run using the OS shell.
73
+ # 📚 https://git.io/JvXDl
74
+
75
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
76
+ # and modify them (or add more) to build your code if your project
77
+ # uses a compiled language
78
+
79
+ #- run: |
80
+ # make bootstrap
81
+ # make release
82
+
83
+ - name: Perform CodeQL Analysis
84
+ uses: github/codeql-action/analyze@v2
.github/workflows/elf-riscv32-cpu-gcc.yml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: elf-riscv32-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/elf-riscv32-cpu-gcc.yml'
7
+ - 'toolchains/riscv32-unknown-elf.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/riscv/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/elf-riscv32-cpu-gcc.yml'
18
+ - 'toolchains/riscv32-unknown-elf.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/riscv/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: elf-riscv32-cpu-gcc-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ newlib-rv32imc-gcc:
33
+ runs-on: [self-hosted, linux, centos]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ #- name: cache-riscv
38
+ #id: cache-riscv
39
+ #uses: actions/cache@v3
40
+ #with:
41
+ #path: rv32imc-install
42
+ #key: rv32imc-newlib-install-20210425
43
+
44
+ #- name: install-riscv-build-deps
45
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
46
+ #run: |
47
+ #sudo apt-get update
48
+ #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
49
+
50
+ #- name: checkout-riscv-gnu-toolchain
51
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
52
+ #uses: actions/checkout@v4
53
+ #with:
54
+ #repository: riscv/riscv-gnu-toolchain
55
+ #path: riscv-gnu-toolchain
56
+ #ref: b715e4f01b43efef487166f75d5d85d3c33fa7ef
57
+ #- name: checkout-riscv-gnu-toolchain-submodules
58
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
59
+ #run: |
60
+ #cd riscv-gnu-toolchain
61
+ #git submodule update --init --recursive --depth 1 riscv-binutils
62
+ #git submodule update --init --recursive --depth 1 riscv-gcc
63
+ #git submodule update --init --recursive --depth 1 riscv-glibc
64
+ #git submodule update --init --recursive --depth 1 riscv-dejagnu
65
+ #git submodule update --init --recursive --depth 1 riscv-newlib
66
+ #git submodule update --init --recursive --depth 1 riscv-gdb
67
+ #- name: riscv-gnu-toolchain
68
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
69
+ #run: |
70
+ #cd riscv-gnu-toolchain
71
+ #./configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-arch=rv32imc
72
+ #make -j2
73
+
74
+ #- name: checkout-riscv-pk
75
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
76
+ #uses: actions/checkout@v4
77
+ #with:
78
+ #repository: riscv/riscv-pk
79
+ #path: riscv-pk
80
+ #ref: ef7bebaf9bf24d3e90bcaae96387ce418e136b6d
81
+ #- name: riscv-pk
82
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
83
+ #run: |
84
+ #cd riscv-pk
85
+ #mkdir build
86
+ #cd build
87
+ #export PATH=$GITHUB_WORKSPACE/rv32imc-install/bin:$PATH
88
+ #../configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-arch=rv32imc --host=riscv32-unknown-elf
89
+ #make -j2
90
+ #make install
91
+
92
+ #- name: checkout-riscv-isa-sim
93
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
94
+ #uses: actions/checkout@v4
95
+ #with:
96
+ #repository: riscv/riscv-isa-sim
97
+ #path: riscv-isa-sim
98
+ #ref: 9d4f45c2ebf105503974fc80a42590ca1584c354
99
+ #- name: riscv-isa-sim
100
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
101
+ #run: |
102
+ #cd riscv-isa-sim
103
+ #mkdir build
104
+ #cd build
105
+ #export PATH=$GITHUB_WORKSPACE/rv32imc-install/bin:$PATH
106
+ #../configure --prefix=$GITHUB_WORKSPACE/rv32imc-install --with-isa=rv32imc
107
+ #make -j2
108
+ #make install
109
+
110
+ #- name: riscv-strip-install
111
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
112
+ #run: find $GITHUB_WORKSPACE/rv32imc-install -type f | xargs -i strip -g {} || true
113
+
114
+ - name: configure
115
+ run: export RISCV_ROOT_PATH=/data/action/osd/rv32imc-install && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv32-unknown-elf.toolchain.cmake -DNCNN_THREADS=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
116
+ - name: build
117
+ run: cmake --build build -j 4
118
+
119
+ # too slow for softfloat arch :(
120
+ #- name: test
121
+ #run: |
122
+ #sudo apt-get update
123
+ #sudo apt-get install device-tree-compiler
124
+ #export PATH=/data/action/osd/rv32imc-install/bin:$PATH
125
+ #cd build
126
+ #TESTS_EXECUTABLE_LOADER=spike TESTS_EXECUTABLE_LOADER_ARGUMENTS=/data/action/osd/rv32imc-install/riscv32-unknown-elf/bin/pk ctest --output-on-failure -j 2
.github/workflows/elf-riscv64-cpu-gcc.yml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: elf-riscv64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/elf-riscv64-cpu-gcc.yml'
7
+ - 'toolchains/riscv64-unknown-elf.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/riscv/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/elf-riscv64-cpu-gcc.yml'
18
+ - 'toolchains/riscv64-unknown-elf.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/riscv/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: elf-riscv64-cpu-gcc-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ newlib-rv64gc-gcc:
33
+ runs-on: [self-hosted, linux, centos]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ #- name: cache-riscv
38
+ #id: cache-riscv
39
+ #uses: actions/cache@v3
40
+ #with:
41
+ #path: rv64gc-install
42
+ #key: rv64gc-newlib-install-20210425
43
+
44
+ #- name: install-riscv-build-deps
45
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
46
+ #run: |
47
+ #sudo apt-get update
48
+ #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
49
+
50
+ #- name: checkout-riscv-gnu-toolchain
51
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
52
+ #uses: actions/checkout@v4
53
+ #with:
54
+ #repository: riscv/riscv-gnu-toolchain
55
+ #path: riscv-gnu-toolchain
56
+ #ref: b715e4f01b43efef487166f75d5d85d3c33fa7ef
57
+ #- name: checkout-riscv-gnu-toolchain-submodules
58
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
59
+ #run: |
60
+ #cd riscv-gnu-toolchain
61
+ #git submodule update --init --recursive --depth 1 riscv-binutils
62
+ #git submodule update --init --recursive --depth 1 riscv-gcc
63
+ #git submodule update --init --recursive --depth 1 riscv-glibc
64
+ #git submodule update --init --recursive --depth 1 riscv-dejagnu
65
+ #git submodule update --init --recursive --depth 1 riscv-newlib
66
+ #git submodule update --init --recursive --depth 1 riscv-gdb
67
+ #- name: riscv-gnu-toolchain
68
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
69
+ #run: |
70
+ #cd riscv-gnu-toolchain
71
+ #sed -i '/__OBSOLETE_MATH/d' riscv-newlib/newlib/libm/common/math_errf.c
72
+ #./configure --prefix=$GITHUB_WORKSPACE/rv64gc-install --with-arch=rv64gc
73
+ #make -j2
74
+
75
+ #- name: checkout-riscv-pk
76
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
77
+ #uses: actions/checkout@v4
78
+ #with:
79
+ #repository: riscv/riscv-pk
80
+ #path: riscv-pk
81
+ #ref: ef7bebaf9bf24d3e90bcaae96387ce418e136b6d
82
+ #- name: riscv-pk
83
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
84
+ #run: |
85
+ #cd riscv-pk
86
+ #mkdir build
87
+ #cd build
88
+ #export PATH=$GITHUB_WORKSPACE/rv64gc-install/bin:$PATH
89
+ #../configure --prefix=$GITHUB_WORKSPACE/rv64gc-install --with-arch=rv64gc --host=riscv64-unknown-elf
90
+ #make -j2
91
+ #make install
92
+
93
+ #- name: checkout-riscv-isa-sim
94
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
95
+ #uses: actions/checkout@v4
96
+ #with:
97
+ #repository: riscv/riscv-isa-sim
98
+ #path: riscv-isa-sim
99
+ #ref: 9d4f45c2ebf105503974fc80a42590ca1584c354
100
+ #- name: riscv-isa-sim
101
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
102
+ #run: |
103
+ #cd riscv-isa-sim
104
+ #mkdir build
105
+ #cd build
106
+ #export PATH=$GITHUB_WORKSPACE/rv64gc-install/bin:$PATH
107
+ #../configure --prefix=$GITHUB_WORKSPACE/rv64gc-install --with-isa=rv64gc
108
+ #make -j2
109
+ #make install
110
+
111
+ #- name: riscv-strip-install
112
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
113
+ #run: find $GITHUB_WORKSPACE/rv64gc-install -type f | xargs -i strip -g {} || true
114
+
115
+ - name: configure
116
+ run: export RISCV_ROOT_PATH=/data/action/osd/rv64gc-install && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-elf.toolchain.cmake -DNCNN_THREADS=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
117
+ - name: build
118
+ run: cmake --build build -j 4
119
+ - name: test
120
+ run: |
121
+ export PATH=/data/action/osd/rv64gc-install/bin:$PATH
122
+ cd build
123
+ TESTS_EXECUTABLE_LOADER=spike TESTS_EXECUTABLE_LOADER_ARGUMENTS=/data/action/osd/rv64gc-install/riscv64-unknown-elf/bin/pk ctest --output-on-failure -j 4
.github/workflows/ios-arm64-gpu.yml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ios-arm64-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/ios-arm64-gpu.yml'
7
+ - 'toolchains/ios.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/arm/**'
13
+ - 'src/layer/vulkan/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/ios-arm64-gpu.yml'
18
+ - 'toolchains/ios.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/arm/**'
24
+ - 'src/layer/vulkan/**'
25
+ concurrency:
26
+ group: ios-arm64-gpu-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ env:
29
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
30
+ IOS_DEPLOYMENT_TARGET: '9.0'
31
+ ENABLE_BITCODE: OFF
32
+ ENABLE_ARC: OFF
33
+ ENABLE_VISIBILITY: OFF
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ ios-iphone-os-gpu:
39
+ runs-on: macos-12
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ submodules: true
44
+
45
+ - name: cache-openmp
46
+ id: cache-openmp
47
+ uses: actions/cache@v3
48
+ with:
49
+ path: openmp-install
50
+ key: openmp-ios-install-20230504
51
+ - name: openmp
52
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
53
+ run: |
54
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
55
+ tar -xf openmp-11.0.0.src.tar.xz
56
+ cd openmp-11.0.0.src
57
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
58
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
59
+ - name: openmp-build-armv7
60
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
61
+ run: |
62
+ cd openmp-11.0.0.src
63
+ mkdir -p build-armv7 && cd build-armv7
64
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \
65
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
66
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
67
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
68
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
69
+ cmake --build . -j 3
70
+ cmake --build . --target install
71
+ - name: openmp-build-arm64
72
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
73
+ run: |
74
+ cd openmp-11.0.0.src
75
+ mkdir -p build-arm64 && cd build-arm64
76
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \
77
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
78
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
79
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
80
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
81
+ cmake --build . -j 3
82
+ cmake --build . --target install
83
+ - name: openmp-build-arm64e
84
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
85
+ run: |
86
+ cd openmp-11.0.0.src
87
+ mkdir -p build-arm64e && cd build-arm64e
88
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \
89
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
90
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
91
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
92
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
93
+ cmake --build . -j 3
94
+ cmake --build . --target install
95
+ - name: openmp-merge-fat-library
96
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
97
+ run: |
98
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
99
+ cp -a openmp-11.0.0.src/build-arm64/install/include $GITHUB_WORKSPACE/openmp-install
100
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
101
+ lipo -create \
102
+ openmp-11.0.0.src/build-armv7/install/lib/libomp.a \
103
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
104
+ openmp-11.0.0.src/build-arm64e/install/lib/libomp.a \
105
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
106
+
107
+ - name: install-openmp
108
+ run: |
109
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
110
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
111
+
112
+ - name: vulkansdk
113
+ run: |
114
+ wget https://sdk.lunarg.com/sdk/download/1.3.236.0/mac/vulkansdk-macos-1.3.236.0.dmg?Human=true -O vulkansdk-macos-1.3.236.0.dmg
115
+ hdiutil attach vulkansdk-macos-1.3.236.0.dmg
116
+ sudo /Volumes/vulkansdk-macos-1.3.236.0/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0 --accept-licenses --default-answer --confirm-command install
117
+ hdiutil detach /Volumes/vulkansdk-macos-1.3.236.0
118
+
119
+ - name: build-arm64
120
+ run: |
121
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
122
+ mkdir build-arm64 && cd build-arm64
123
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \
124
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
125
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
126
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
127
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \
128
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
129
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/iOS/libMoltenVK.dylib \
130
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
131
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
132
+ cmake --build . -j 3
133
+ - name: build-arm64e
134
+ run: |
135
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
136
+ mkdir build-arm64e && cd build-arm64e
137
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \
138
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
139
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
140
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
141
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \
142
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
143
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/iOS/libMoltenVK.dylib \
144
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
145
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
146
+ cmake --build . -j 3
.github/workflows/ios-cpu.yml ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ios-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/ios-cpu.yml'
7
+ - 'toolchains/ios.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/arm/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/ios-cpu.yml'
17
+ - 'toolchains/ios.toolchain.cmake'
18
+ - 'CMakeLists.txt'
19
+ - 'cmake/**'
20
+ - 'src/*'
21
+ - 'src/layer/*'
22
+ - 'src/layer/arm/**'
23
+ concurrency:
24
+ group: ios-cpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ env:
27
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
28
+ IOS_DEPLOYMENT_TARGET: '9.0'
29
+ ENABLE_BITCODE: OFF
30
+ ENABLE_ARC: OFF
31
+ ENABLE_VISIBILITY: OFF
32
+ permissions:
33
+ contents: read
34
+
35
+ jobs:
36
+ ios-iphone-os:
37
+ runs-on: macos-12
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - name: cache-openmp
42
+ id: cache-openmp
43
+ uses: actions/cache@v3
44
+ with:
45
+ path: openmp-install
46
+ key: openmp-ios-install-20230504
47
+ - name: openmp
48
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
49
+ run: |
50
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
51
+ tar -xf openmp-11.0.0.src.tar.xz
52
+ cd openmp-11.0.0.src
53
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
54
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
55
+ - name: openmp-build-armv7
56
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
57
+ run: |
58
+ cd openmp-11.0.0.src
59
+ mkdir -p build-armv7 && cd build-armv7
60
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \
61
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
62
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
63
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
64
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
65
+ cmake --build . -j 3
66
+ cmake --build . --target install
67
+ - name: openmp-build-arm64
68
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
69
+ run: |
70
+ cd openmp-11.0.0.src
71
+ mkdir -p build-arm64 && cd build-arm64
72
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \
73
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
74
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
75
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
76
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
77
+ cmake --build . -j 3
78
+ cmake --build . --target install
79
+ - name: openmp-build-arm64e
80
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
81
+ run: |
82
+ cd openmp-11.0.0.src
83
+ mkdir -p build-arm64e && cd build-arm64e
84
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \
85
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
86
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
87
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
88
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
89
+ cmake --build . -j 3
90
+ cmake --build . --target install
91
+ - name: openmp-merge-fat-library
92
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
93
+ run: |
94
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
95
+ cp -a openmp-11.0.0.src/build-arm64/install/include $GITHUB_WORKSPACE/openmp-install
96
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
97
+ lipo -create \
98
+ openmp-11.0.0.src/build-armv7/install/lib/libomp.a \
99
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
100
+ openmp-11.0.0.src/build-arm64e/install/lib/libomp.a \
101
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
102
+
103
+ - name: install-openmp
104
+ run: |
105
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
106
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
107
+
108
+ - name: build-armv7
109
+ run: |
110
+ mkdir build-armv7 && cd build-armv7
111
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \
112
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
113
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
114
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
115
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \
116
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
117
+ ..
118
+ cmake --build . -j 3
119
+ - name: build-arm64
120
+ run: |
121
+ mkdir build-arm64 && cd build-arm64
122
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \
123
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
124
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
125
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
126
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \
127
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
128
+ ..
129
+ cmake --build . -j 3
130
+ - name: build-arm64e
131
+ run: |
132
+ mkdir build-arm64e && cd build-arm64e
133
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \
134
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
135
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
136
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
137
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \
138
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
139
+ ..
140
+ cmake --build . -j 3
.github/workflows/ios-simulator-gpu.yml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ios-simulator-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/ios-simulator-gpu.yml'
7
+ - 'toolchains/ios.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'src/layer/arm/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/ios-simulator-gpu.yml'
18
+ - 'toolchains/ios.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/x86/**'
24
+ - 'src/layer/arm/**'
25
+ concurrency:
26
+ group: ios-simulator-gpu-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ env:
29
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
30
+ IOS_DEPLOYMENT_TARGET: '9.0'
31
+ ENABLE_BITCODE: OFF
32
+ ENABLE_ARC: OFF
33
+ ENABLE_VISIBILITY: OFF
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ ios-iphone-simulator-gpu:
39
+ runs-on: macos-12
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ submodules: true
44
+
45
+ - name: cache-openmp
46
+ id: cache-openmp
47
+ uses: actions/cache@v3
48
+ with:
49
+ path: openmp-install
50
+ key: openmp-ios-simulator-install-20230504
51
+ - name: openmp
52
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
53
+ run: |
54
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
55
+ tar -xf openmp-11.0.0.src.tar.xz
56
+ cd openmp-11.0.0.src
57
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
58
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
59
+ - name: openmp-build-i386
60
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
61
+ run: |
62
+ cd openmp-11.0.0.src
63
+ mkdir -p build-i386 && cd build-i386
64
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \
65
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
66
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
67
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
68
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
69
+ cmake --build . -j 3
70
+ cmake --build . --target install
71
+ - name: openmp-build-x86_64
72
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
73
+ run: |
74
+ cd openmp-11.0.0.src
75
+ mkdir -p build-x86_64 && cd build-x86_64
76
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \
77
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
78
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
79
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
80
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
81
+ cmake --build . -j 3
82
+ cmake --build . --target install
83
+ - name: openmp-build-arm64
84
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
85
+ run: |
86
+ cd openmp-11.0.0.src
87
+ mkdir -p build-arm64 && cd build-arm64
88
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \
89
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
90
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
91
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
92
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
93
+ cmake --build . -j 3
94
+ cmake --build . --target install
95
+ - name: openmp-merge-fat-library
96
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
97
+ run: |
98
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
99
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
100
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
101
+ lipo -create \
102
+ openmp-11.0.0.src/build-i386/install/lib/libomp.a \
103
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
104
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
105
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
106
+
107
+ - name: openmp-install
108
+ run: |
109
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include
110
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
111
+
112
+ - name: vulkansdk
113
+ run: |
114
+ wget https://sdk.lunarg.com/sdk/download/1.3.236.0/mac/vulkansdk-macos-1.3.236.0.dmg?Human=true -O vulkansdk-macos-1.3.236.0.dmg
115
+ hdiutil attach vulkansdk-macos-1.3.236.0.dmg
116
+ sudo /Volumes/vulkansdk-macos-1.3.236.0/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0 --accept-licenses --default-answer --confirm-command install
117
+ hdiutil detach /Volumes/vulkansdk-macos-1.3.236.0
118
+
119
+ - name: build-x86_64
120
+ run: |
121
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
122
+ mkdir build-x86_64 && cd build-x86_64
123
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \
124
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
125
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
126
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
127
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \
128
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
129
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/macOS/libMoltenVK.dylib \
130
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
131
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
132
+ cmake --build . -j 3
133
+ - name: build-arm64
134
+ run: |
135
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
136
+ mkdir build-arm64 && cd build-arm64
137
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \
138
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
139
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
140
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
141
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \
142
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
143
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/macOS/libMoltenVK.dylib \
144
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
145
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
146
+ cmake --build . -j 3
.github/workflows/ios-simulator.yml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ios-simulator
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/ios-simulator.yml'
7
+ - 'toolchains/ios.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'src/layer/arm/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/ios-simulator.yml'
18
+ - 'toolchains/ios.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/x86/**'
24
+ - 'src/layer/arm/**'
25
+ concurrency:
26
+ group: ios-simulator-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ env:
29
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
30
+ IOS_DEPLOYMENT_TARGET: '9.0'
31
+ ENABLE_BITCODE: OFF
32
+ ENABLE_ARC: OFF
33
+ ENABLE_VISIBILITY: OFF
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ ios-iphone-simulator:
39
+ runs-on: macos-12
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: cache-openmp
44
+ id: cache-openmp
45
+ uses: actions/cache@v3
46
+ with:
47
+ path: openmp-install
48
+ key: openmp-ios-simulator-install-20230504
49
+ - name: openmp
50
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
51
+ run: |
52
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
53
+ tar -xf openmp-11.0.0.src.tar.xz
54
+ cd openmp-11.0.0.src
55
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
56
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
57
+ - name: openmp-build-i386
58
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd openmp-11.0.0.src
61
+ mkdir -p build-i386 && cd build-i386
62
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \
63
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
64
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
65
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
66
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
67
+ cmake --build . -j 3
68
+ cmake --build . --target install
69
+ - name: openmp-build-x86_64
70
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
71
+ run: |
72
+ cd openmp-11.0.0.src
73
+ mkdir -p build-x86_64 && cd build-x86_64
74
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \
75
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
76
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
77
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
78
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
79
+ cmake --build . -j 3
80
+ cmake --build . --target install
81
+ - name: openmp-build-arm64
82
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
83
+ run: |
84
+ cd openmp-11.0.0.src
85
+ mkdir -p build-arm64 && cd build-arm64
86
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \
87
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
88
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
89
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
90
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
91
+ cmake --build . -j 3
92
+ cmake --build . --target install
93
+ - name: openmp-merge-fat-library
94
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
95
+ run: |
96
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
97
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
98
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
99
+ lipo -create \
100
+ openmp-11.0.0.src/build-i386/install/lib/libomp.a \
101
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
102
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
103
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
104
+
105
+ - name: openmp-install
106
+ run: |
107
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include
108
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
109
+
110
+ - name: build-i386
111
+ run: |
112
+ mkdir build-i386 && cd build-i386
113
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \
114
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
115
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
116
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
117
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \
118
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
119
+ ..
120
+ cmake --build . -j 3
121
+ - name: build-x86_64
122
+ run: |
123
+ mkdir build-x86_64 && cd build-x86_64
124
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \
125
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
126
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
127
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
128
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \
129
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
130
+ ..
131
+ cmake --build . -j 3
132
+ - name: build-arm64
133
+ run: |
134
+ mkdir build-arm64 && cd build-arm64
135
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \
136
+ -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
137
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
138
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
139
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \
140
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
141
+ ..
142
+ cmake --build . -j 3
.github/workflows/linux-aarch64-cpu-gcc.yml ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-aarch64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-aarch64-cpu-gcc.yml'
7
+ - 'toolchains/aarch64-linux-gnu.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/arm/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/linux-aarch64-cpu-gcc.yml'
18
+ - 'toolchains/aarch64-linux-gnu.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/arm/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: linux-aarch64-cpu-gcc-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ linux-gcc:
33
+ runs-on: ubuntu-20.04
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - name: cache-qemu
38
+ id: cache-qemu
39
+ uses: actions/cache@v3
40
+ with:
41
+ path: qemu-install
42
+ key: qemu-aarch64-install-20220502-ubuntu-2004-2
43
+ - name: install-qemu-build-deps
44
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
45
+ run: |
46
+ sudo apt-get update
47
+ sudo apt-get install autoconf automake autotools-dev ninja-build
48
+ - name: checkout-qemu
49
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
50
+ uses: actions/checkout@v4
51
+ with:
52
+ repository: qemu/qemu
53
+ path: qemu
54
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
55
+ - name: qemu
56
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
57
+ run: |
58
+ cd qemu
59
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
60
+ make -j2
61
+ make install
62
+
63
+ - name: aarch64-gnu-toolchain
64
+ run: |
65
+ sudo apt-get update
66
+ sudo apt-get install g++-aarch64-linux-gnu
67
+
68
+ - name: build
69
+ run: |
70
+ mkdir build && cd build
71
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=OFF -DNCNN_ARM82DOT=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
72
+ cmake --build . -j 2
73
+ - name: test
74
+ run: |
75
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
76
+ cd build
77
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
78
+
79
+ - name: build-noint8
80
+ run: |
81
+ mkdir build-noint8 && cd build-noint8
82
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=OFF -DNCNN_ARM82DOT=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
83
+ cmake --build . -j 2
84
+ - name: test-noint8
85
+ run: |
86
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
87
+ cd build-noint8
88
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
89
+
90
+ linux-gcc-arm82:
91
+ runs-on: ubuntu-20.04
92
+ steps:
93
+ - uses: actions/checkout@v4
94
+
95
+ - name: cache-qemu
96
+ id: cache-qemu
97
+ uses: actions/cache@v3
98
+ with:
99
+ path: qemu-install
100
+ key: qemu-aarch64-install-20220502-ubuntu-2004-2
101
+ - name: install-qemu-build-deps
102
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
103
+ run: |
104
+ sudo apt-get update
105
+ sudo apt-get install autoconf automake autotools-dev ninja-build
106
+ - name: checkout-qemu
107
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
108
+ uses: actions/checkout@v4
109
+ with:
110
+ repository: qemu/qemu
111
+ path: qemu
112
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
113
+ - name: qemu
114
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
115
+ run: |
116
+ cd qemu
117
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
118
+ make -j2
119
+ make install
120
+
121
+ - name: aarch64-gnu-toolchain
122
+ run: |
123
+ sudo apt-get update
124
+ sudo apt-get install g++-aarch64-linux-gnu
125
+
126
+ - name: build
127
+ run: |
128
+ mkdir build && cd build
129
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
130
+ cmake --build . -j 2
131
+ - name: test
132
+ run: |
133
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
134
+ cd build
135
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
136
+
137
+ - name: build-noint8
138
+ run: |
139
+ mkdir build-noint8 && cd build-noint8
140
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DNCNN_INT8=OFF ..
141
+ cmake --build . -j 2
142
+ - name: test-noint8
143
+ run: |
144
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
145
+ cd build-noint8
146
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
147
+
148
+ linux-gcc-arm86:
149
+ runs-on: ubuntu-22.04
150
+ steps:
151
+ - uses: actions/checkout@v4
152
+
153
+ - name: cache-qemu
154
+ id: cache-qemu
155
+ uses: actions/cache@v3
156
+ with:
157
+ path: qemu-install
158
+ key: qemu-aarch64-install-20230717
159
+ - name: install-qemu-build-deps
160
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
161
+ run: |
162
+ sudo apt-get update
163
+ sudo apt-get install autoconf automake autotools-dev ninja-build
164
+ - name: checkout-qemu
165
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
166
+ uses: actions/checkout@v4
167
+ with:
168
+ repository: qemu/qemu
169
+ path: qemu
170
+ ref: ed8ad9728a9c0eec34db9dff61dfa2f1dd625637
171
+ - name: qemu
172
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
173
+ run: |
174
+ cd qemu
175
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
176
+ make -j2
177
+ make install
178
+
179
+ - name: aarch64-gnu-toolchain
180
+ run: |
181
+ sudo apt-get update
182
+ sudo apt-get install g++-aarch64-linux-gnu
183
+
184
+ - name: build
185
+ run: |
186
+ mkdir build && cd build
187
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
188
+ cmake --build . -j 2
189
+ - name: test
190
+ run: |
191
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
192
+ cd build
193
+ TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
.github/workflows/linux-arm-cpu-gcc.yml ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-arm-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-arm-cpu-gcc.yml'
7
+ - 'toolchains/arm-linux-gnueabi.toolchain.cmake'
8
+ - 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
9
+ - 'CMakeLists.txt'
10
+ - 'cmake/**'
11
+ - 'src/*'
12
+ - 'src/layer/*'
13
+ - 'src/layer/arm/**'
14
+ - 'tests/**'
15
+ pull_request:
16
+ branches: [master]
17
+ paths:
18
+ - '.github/workflows/linux-arm-cpu-gcc.yml'
19
+ - 'toolchains/arm-linux-gnueabi.toolchain.cmake'
20
+ - 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/arm/**'
26
+ - 'tests/**'
27
+ concurrency:
28
+ group: linux-arm-cpu-gcc-${{ github.ref }}
29
+ cancel-in-progress: true
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ linux-gcc-arm:
35
+ runs-on: ubuntu-20.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: cache-qemu
40
+ id: cache-qemu
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: qemu-install
44
+ key: qemu-arm-install-20220502-2
45
+ - name: install-qemu-build-deps
46
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
47
+ run: |
48
+ sudo apt-get update
49
+ sudo apt-get install autoconf automake autotools-dev ninja-build
50
+ - name: checkout-qemu
51
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: qemu/qemu
55
+ path: qemu
56
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
57
+ - name: qemu
58
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd qemu
61
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system
62
+ make -j2
63
+ make install
64
+
65
+ - name: arm-gnu-toolchain
66
+ run: |
67
+ sudo apt-get update
68
+ sudo apt-get install g++-arm-linux-gnueabi
69
+
70
+ - name: build
71
+ run: |
72
+ mkdir build && cd build
73
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
74
+ cmake --build . -j 2
75
+ - name: test
76
+ run: |
77
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
78
+ cd build
79
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j 2
80
+
81
+ - name: build-noint8
82
+ run: |
83
+ mkdir build-noint8 && cd build-noint8
84
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
85
+ cmake --build . -j 2
86
+ - name: test-noint8
87
+ run: |
88
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
89
+ cd build-noint8
90
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j 2
91
+
92
+ linux-gcc-armhf:
93
+ runs-on: ubuntu-20.04
94
+ steps:
95
+ - uses: actions/checkout@v4
96
+
97
+ - name: cache-qemu
98
+ id: cache-qemu
99
+ uses: actions/cache@v3
100
+ with:
101
+ path: qemu-install
102
+ key: qemu-arm-install-20220502-2
103
+ - name: install-qemu-build-deps
104
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
105
+ run: |
106
+ sudo apt-get update
107
+ sudo apt-get install autoconf automake autotools-dev ninja-build
108
+ - name: checkout-qemu
109
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
110
+ uses: actions/checkout@v4
111
+ with:
112
+ repository: qemu/qemu
113
+ path: qemu
114
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
115
+ - name: qemu
116
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
117
+ run: |
118
+ cd qemu
119
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system
120
+ make -j2
121
+ make install
122
+
123
+ - name: arm-gnu-toolchain
124
+ run: |
125
+ sudo apt-get update
126
+ sudo apt-get install g++-arm-linux-gnueabihf
127
+
128
+ - name: build
129
+ run: |
130
+ mkdir build && cd build
131
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
132
+ cmake --build . -j 2
133
+ - name: test
134
+ run: |
135
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
136
+ cd build
137
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2
138
+
139
+ - name: build-noint8
140
+ run: |
141
+ mkdir build-noint8 && cd build-noint8
142
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DNCNN_INT8=OFF ..
143
+ cmake --build . -j 2
144
+ - name: test-noint8
145
+ run: |
146
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
147
+ cd build-noint8
148
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2
149
+
150
+ linux-gcc-armhf-vfpv3-d16:
151
+ runs-on: ubuntu-20.04
152
+ steps:
153
+ - uses: actions/checkout@v4
154
+
155
+ - name: cache-qemu
156
+ id: cache-qemu
157
+ uses: actions/cache@v3
158
+ with:
159
+ path: qemu-install
160
+ key: qemu-arm-install-20220502-2
161
+ - name: install-qemu-build-deps
162
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
163
+ run: |
164
+ sudo apt-get update
165
+ sudo apt-get install autoconf automake autotools-dev ninja-build
166
+ - name: checkout-qemu
167
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
168
+ uses: actions/checkout@v4
169
+ with:
170
+ repository: qemu/qemu
171
+ path: qemu
172
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
173
+ - name: qemu
174
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
175
+ run: |
176
+ cd qemu
177
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system
178
+ make -j2
179
+ make install
180
+
181
+ - name: arm-gnu-toolchain
182
+ run: |
183
+ sudo apt-get update
184
+ sudo apt-get install g++-arm-linux-gnueabihf
185
+
186
+ - name: build
187
+ run: |
188
+ mkdir build && cd build
189
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
190
+ cmake --build . -j 2
191
+ - name: test
192
+ run: |
193
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
194
+ cd build
195
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2
196
+
197
+ - name: build-noint8
198
+ run: |
199
+ mkdir build-noint8 && cd build-noint8
200
+ 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 ..
201
+ cmake --build . -j 2
202
+ - name: test-noint8
203
+ run: |
204
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
205
+ cd build-noint8
206
+ TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2
.github/workflows/linux-loongarch64-cpu-gcc.yml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-loongarch64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-loongarch64-cpu-gcc.yml'
7
+ - 'toolchains/loongarch64-linux-gnu.toolchain.cmake'
8
+ - 'toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake'
9
+ - 'CMakeLists.txt'
10
+ - 'cmake/**'
11
+ - 'src/*'
12
+ - 'src/layer/*'
13
+ - 'src/layer/loongarch/**'
14
+ - 'tests/**'
15
+ pull_request:
16
+ branches: [master]
17
+ paths:
18
+ - '.github/workflows/linux-loongarch64-cpu-gcc.yml'
19
+ - 'toolchains/loongarch64-linux-gnu.toolchain.cmake'
20
+ - 'toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/loongarch/**'
26
+ - 'tests/**'
27
+ concurrency:
28
+ group: linux-loongarch64-cpu-gcc-${{ github.ref }}
29
+ cancel-in-progress: true
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ linux-gcc-loongarch64:
35
+ runs-on: [self-hosted, linux, centos]
36
+
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ # - name: cache-qemu
41
+ # id: cache-qemu
42
+ # uses: actions/cache@v3
43
+ # with:
44
+ # path: qemu-install
45
+ # key: qemu-loongarch64-install-20230524
46
+ # - name: checkout-qemu
47
+ # if: steps.cache-qemu.outputs.cache-hit != 'true'
48
+ # uses: actions/checkout@v4
49
+ # with:
50
+ # repository: qemu/qemu
51
+ # path: qemu
52
+ # ref: 1c12355b31046a6b35a4f50c85c4f01afb1bd728
53
+ # - name: qemu
54
+ # if: steps.cache-qemu.outputs.cache-hit != 'true'
55
+ # run: |
56
+ # cd qemu
57
+ # ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=loongarch64-linux-user --disable-system
58
+ # make -j2
59
+ # make install
60
+
61
+ # - name: loongarch64-toolchain
62
+ # run: |
63
+ # wget https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/download/8.0/loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz
64
+ # tar -xf loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz
65
+
66
+ - name: build
67
+ run: |
68
+ export LOONGARCH64_ROOT_PATH=/data/action/osd/cross-tools
69
+ mkdir build && cd build
70
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
71
+ cmake --build . -j 4
72
+
73
+ - name: test
74
+ run: |
75
+ export PATH=/data/action/osd/qemu-loongson/qemu-install/bin:$PATH
76
+ cd build
77
+ TESTS_EXECUTABLE_LOADER=qemu-loongarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/data/action/osd/cross-tools/target" ctest --output-on-failure -j 4
.github/workflows/linux-mips-cpu-gcc.yml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-mips-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-mips-cpu-gcc.yml'
7
+ - 'toolchains/mipsel-linux-gnu.toolchain.cmake'
8
+ - 'toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake'
9
+ - 'CMakeLists.txt'
10
+ - 'cmake/**'
11
+ - 'src/*'
12
+ - 'src/layer/*'
13
+ - 'src/layer/mips/**'
14
+ - 'tests/**'
15
+ pull_request:
16
+ branches: [master]
17
+ paths:
18
+ - '.github/workflows/linux-mips-cpu-gcc.yml'
19
+ - 'toolchains/mipsel-linux-gnu.toolchain.cmake'
20
+ - 'toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/mips/**'
26
+ - 'tests/**'
27
+ concurrency:
28
+ group: linux-mips-cpu-gcc-${{ github.ref }}
29
+ cancel-in-progress: true
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ linux-gcc-mipsel:
35
+ runs-on: ubuntu-20.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: cache-qemu
40
+ id: cache-qemu
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: qemu-install
44
+ key: qemu-mipsel-install-20220502-2
45
+ - name: install-qemu-build-deps
46
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
47
+ run: |
48
+ sudo apt-get update
49
+ sudo apt-get install autoconf automake autotools-dev ninja-build
50
+ - name: checkout-qemu
51
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: qemu/qemu
55
+ path: qemu
56
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
57
+ - name: qemu
58
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd qemu
61
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mipsel-linux-user --disable-system
62
+ make -j2
63
+ make install
64
+
65
+ - name: mipsel-gnu-toolchain
66
+ run: |
67
+ sudo apt-get update
68
+ sudo apt-get install g++-mipsel-linux-gnu
69
+
70
+ - name: configure
71
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsel-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
72
+ - name: build
73
+ run: cmake --build build -j 2
74
+
75
+ - name: test
76
+ run: |
77
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
78
+ cd build
79
+ TESTS_EXECUTABLE_LOADER=qemu-mipsel TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsel-linux-gnu" ctest --output-on-failure -j 2
80
+
81
+ linux-gcc-mipsisa32r6el:
82
+ runs-on: ubuntu-20.04
83
+ steps:
84
+ - uses: actions/checkout@v4
85
+
86
+ - name: cache-qemu
87
+ id: cache-qemu
88
+ uses: actions/cache@v3
89
+ with:
90
+ path: qemu-install
91
+ key: qemu-mipsel-install-20220502-2
92
+ - name: install-qemu-build-deps
93
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
94
+ run: |
95
+ sudo apt-get update
96
+ sudo apt-get install autoconf automake autotools-dev ninja-build
97
+ - name: checkout-qemu
98
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
99
+ uses: actions/checkout@v4
100
+ with:
101
+ repository: qemu/qemu
102
+ path: qemu
103
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
104
+ - name: qemu
105
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
106
+ run: |
107
+ cd qemu
108
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mipsel-linux-user --disable-system
109
+ make -j2
110
+ make install
111
+
112
+ - name: mipsisa32r6el-gnu-toolchain
113
+ run: |
114
+ sudo apt-get update
115
+ sudo apt-get install g++-mipsisa32r6el-linux-gnu
116
+
117
+ - name: configure
118
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
119
+ - name: build
120
+ run: cmake --build build -j 2
121
+
122
+ - name: test
123
+ run: |
124
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
125
+ cd build
126
+ TESTS_EXECUTABLE_LOADER=qemu-mipsel TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa32r6el-linux-gnu" ctest --output-on-failure -j 2
.github/workflows/linux-mips64-cpu-gcc.yml ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-mips64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-mips64-cpu-gcc.yml'
7
+ - 'toolchains/mips64el-linux-gnuabi64.toolchain.cmake'
8
+ - 'toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake'
9
+ - 'CMakeLists.txt'
10
+ - 'cmake/**'
11
+ - 'src/*'
12
+ - 'src/layer/*'
13
+ - 'src/layer/mips/**'
14
+ - 'tests/**'
15
+ pull_request:
16
+ branches: [master]
17
+ paths:
18
+ - '.github/workflows/linux-mips64-cpu-gcc.yml'
19
+ - 'toolchains/mips64el-linux-gnuabi64.toolchain.cmake'
20
+ - 'toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/mips/**'
26
+ - 'tests/**'
27
+ concurrency:
28
+ group: linux-mips64-cpu-gcc-${{ github.ref }}
29
+ cancel-in-progress: true
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ linux-gcc-mips64el:
35
+ runs-on: ubuntu-20.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: cache-qemu
40
+ id: cache-qemu
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: qemu-install
44
+ key: qemu-mips64el-install-20220502-2
45
+ - name: install-qemu-build-deps
46
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
47
+ run: |
48
+ sudo apt-get update
49
+ sudo apt-get install autoconf automake autotools-dev ninja-build
50
+ - name: checkout-qemu
51
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: qemu/qemu
55
+ path: qemu
56
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
57
+ - name: qemu
58
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd qemu
61
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mips64el-linux-user --disable-system
62
+ make -j2
63
+ make install
64
+
65
+ - name: mips64el-gnuabi64-toolchain
66
+ run: |
67
+ sudo apt-get update
68
+ sudo apt-get install g++-mips64el-linux-gnuabi64
69
+
70
+ - name: configure
71
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
72
+ - name: build
73
+ run: cmake --build build -j 2
74
+
75
+ - name: test
76
+ run: |
77
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
78
+ cd build
79
+ TESTS_EXECUTABLE_LOADER=qemu-mips64el TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mips64el-linux-gnuabi64" ctest --output-on-failure -j 2
80
+
81
+ linux-gcc-mipsisa64r6el:
82
+ runs-on: ubuntu-20.04
83
+ steps:
84
+ - uses: actions/checkout@v4
85
+
86
+ - name: cache-qemu
87
+ id: cache-qemu
88
+ uses: actions/cache@v3
89
+ with:
90
+ path: qemu-install
91
+ key: qemu-mips64el-install-20220502-4
92
+ - name: install-qemu-build-deps
93
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
94
+ run: |
95
+ sudo apt-get update
96
+ sudo apt-get install autoconf automake autotools-dev ninja-build
97
+ - name: checkout-qemu
98
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
99
+ uses: actions/checkout@v4
100
+ with:
101
+ repository: qemu/qemu
102
+ path: qemu
103
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
104
+ - name: qemu
105
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
106
+ run: |
107
+ cd qemu
108
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0001-target-mips-Fix-SAT_S-trans-helper.patch
109
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0002-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
110
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0003-target-mips-Fix-msa-checking-condition-in-trans_msa_.patch
111
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0004-target-mips-Do-not-treat-msa-INSERT-as-NOP-when-wd-i.patch
112
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0005-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
113
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0006-target-mips-Fix-store-adress-of-high-64bit-in-helper.patch
114
+ patch -p1 -i 0001-target-mips-Fix-SAT_S-trans-helper.patch
115
+ patch -p1 -i 0002-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
116
+ patch -p1 -i 0003-target-mips-Fix-msa-checking-condition-in-trans_msa_.patch
117
+ patch -p1 -i 0004-target-mips-Do-not-treat-msa-INSERT-as-NOP-when-wd-i.patch
118
+ patch -p1 -i 0005-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
119
+ patch -p1 -i 0006-target-mips-Fix-store-adress-of-high-64bit-in-helper.patch
120
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mips64el-linux-user --disable-system
121
+ make -j2
122
+ make install
123
+
124
+ - name: mipsisa64r6el-gnuabi64-toolchain
125
+ run: |
126
+ sudo apt-get update
127
+ sudo apt-get install g++-mipsisa64r6el-linux-gnuabi64
128
+
129
+ - name: configure
130
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
131
+ - name: build
132
+ run: cmake --build build -j 2
133
+
134
+ - name: test
135
+ run: |
136
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
137
+ cd build
138
+ TESTS_EXECUTABLE_LOADER=qemu-mips64el TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa64r6el-linux-gnuabi64" ctest --output-on-failure -j 2
.github/workflows/linux-ppc64-cpu-gcc.yml ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-ppc64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-ppc64-cpu-gcc.yml'
7
+ - 'toolchains/powerpc64le-linux-gnu.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'tests/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/linux-ppc64-cpu-gcc.yml'
17
+ - 'toolchains/powerpc64le-linux-gnu.toolchain.cmake'
18
+ - 'CMakeLists.txt'
19
+ - 'cmake/**'
20
+ - 'src/*'
21
+ - 'src/layer/*'
22
+ - 'tests/**'
23
+ concurrency:
24
+ group: linux-ppc64-cpu-gcc-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ linux-gcc-ppc64le:
31
+ runs-on: ubuntu-20.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: cache-qemu
36
+ id: cache-qemu
37
+ uses: actions/cache@v3
38
+ with:
39
+ path: qemu-install
40
+ key: qemu-ppc64le-install-20220502-2
41
+ - name: install-qemu-build-deps
42
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
43
+ run: |
44
+ sudo apt-get update
45
+ sudo apt-get install autoconf automake autotools-dev ninja-build
46
+ - name: checkout-qemu
47
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
48
+ uses: actions/checkout@v4
49
+ with:
50
+ repository: qemu/qemu
51
+ path: qemu
52
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
53
+ - name: qemu
54
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
55
+ run: |
56
+ cd qemu
57
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=ppc64le-linux-user --disable-system
58
+ make -j2
59
+ make install
60
+
61
+ - name: powerpc64le-gnu-toolchain
62
+ run: |
63
+ sudo apt-get update
64
+ sudo apt-get install g++-powerpc64le-linux-gnu
65
+
66
+ - name: configure
67
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/powerpc64le-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
68
+ - name: build
69
+ run: cmake --build build -j 2
70
+
71
+ - name: test
72
+ run: |
73
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
74
+ cd build
75
+ TESTS_EXECUTABLE_LOADER=qemu-ppc64le TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/powerpc64le-linux-gnu" ctest --output-on-failure -j 2
76
+ linux-gcc-power8le-vsx:
77
+ runs-on: ubuntu-20.04
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+
81
+ - name: cache-qemu
82
+ id: cache-qemu
83
+ uses: actions/cache@v3
84
+ with:
85
+ path: qemu-install
86
+ key: qemu-ppc64le-install-20220502-2
87
+ - name: install-qemu-build-deps
88
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
89
+ run: |
90
+ sudo apt-get update
91
+ sudo apt-get install autoconf automake autotools-dev ninja-build
92
+ - name: checkout-qemu
93
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
94
+ uses: actions/checkout@v4
95
+ with:
96
+ repository: qemu/qemu
97
+ path: qemu
98
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
99
+ - name: qemu
100
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
101
+ run: |
102
+ cd qemu
103
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=ppc64le-linux-user --disable-system
104
+ make -j2
105
+ make install
106
+
107
+ - name: powerpc64le-gnu-toolchain
108
+ run: |
109
+ sudo apt-get update
110
+ sudo apt-get install g++-powerpc64le-linux-gnu
111
+
112
+ - name: configure
113
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/power8le-linux-gnu-vsx.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
114
+ - name: build
115
+ run: cmake --build build -j 2
116
+
117
+ - name: test
118
+ run: |
119
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
120
+ cd build
121
+ TESTS_EXECUTABLE_LOADER=qemu-ppc64le TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/powerpc64le-linux-gnu;-cpu;power8_v2.0" ctest --output-on-failure -j 2
122
+ linux-gcc-power9le-vsx:
123
+ runs-on: ubuntu-20.04
124
+ steps:
125
+ - uses: actions/checkout@v4
126
+
127
+ - name: cache-qemu
128
+ id: cache-qemu
129
+ uses: actions/cache@v3
130
+ with:
131
+ path: qemu-install
132
+ key: qemu-ppc64le-install-20220502-2
133
+ - name: install-qemu-build-deps
134
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
135
+ run: |
136
+ sudo apt-get update
137
+ sudo apt-get install autoconf automake autotools-dev ninja-build
138
+ - name: checkout-qemu
139
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
140
+ uses: actions/checkout@v4
141
+ with:
142
+ repository: qemu/qemu
143
+ path: qemu
144
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
145
+ - name: qemu
146
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
147
+ run: |
148
+ cd qemu
149
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=ppc64le-linux-user --disable-system
150
+ make -j2
151
+ make install
152
+
153
+ - name: powerpc64le-gnu-toolchain
154
+ run: |
155
+ sudo apt-get update
156
+ sudo apt-get install g++-powerpc64le-linux-gnu
157
+
158
+ - name: configure
159
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/power9le-linux-gnu-vsx.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
160
+ - name: build
161
+ run: cmake --build build -j 2
162
+
163
+ - name: test
164
+ run: |
165
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
166
+ cd build
167
+ TESTS_EXECUTABLE_LOADER=qemu-ppc64le TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/powerpc64le-linux-gnu;-cpu;power9_v2.0" ctest --output-on-failure -j 2
.github/workflows/linux-riscv64-cpu-gcc.yml ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-riscv64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-riscv64-cpu-gcc.yml'
7
+ - 'toolchains/riscv64-linux-gnu.toolchain.cmake'
8
+ - 'toolchains/riscv64-unknown-linux-gnu.toolchain.cmake'
9
+ - 'CMakeLists.txt'
10
+ - 'cmake/**'
11
+ - 'src/*'
12
+ - 'src/layer/*'
13
+ - 'src/layer/riscv/**'
14
+ - 'tests/**'
15
+ pull_request:
16
+ branches: [master]
17
+ paths:
18
+ - '.github/workflows/linux-riscv64-cpu-gcc.yml'
19
+ - 'toolchains/riscv64-linux-gnu.toolchain.cmake'
20
+ - 'toolchains/riscv64-unknown-linux-gnu.toolchain.cmake'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/riscv/**'
26
+ - 'tests/**'
27
+ concurrency:
28
+ group: linux-riscv64-cpu-gcc-${{ github.ref }}
29
+ cancel-in-progress: true
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ linux-gcc-riscv64:
35
+ runs-on: ubuntu-20.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: cache-qemu
40
+ id: cache-qemu
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: qemu-install
44
+ key: qemu-riscv64-install-20220502-4
45
+ - name: install-qemu-build-deps
46
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
47
+ run: |
48
+ sudo apt-get update
49
+ sudo apt-get install autoconf automake autotools-dev ninja-build
50
+ - name: checkout-qemu
51
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: qemu/qemu
55
+ path: qemu
56
+ ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
57
+ - name: qemu
58
+ if: steps.cache-qemu.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd qemu
61
+ wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
62
+ patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
63
+ ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
64
+ make -j2
65
+ make install
66
+
67
+ - name: riscv64-gnu-toolchain
68
+ run: |
69
+ sudo apt-get update
70
+ sudo apt-get install g++-riscv64-linux-gnu
71
+
72
+ - name: configure
73
+ run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
74
+ - name: build
75
+ run: cmake --build build -j 2
76
+
77
+ - name: test
78
+ run: |
79
+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
80
+ cd build
81
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j 2
82
+
83
+ linux-gcc-riscv64-c906:
84
+ runs-on: [self-hosted, linux, centos]
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+
88
+ - name: configure
89
+ run: |
90
+ export RISCV_ROOT_PATH=/data/action/osd/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1
91
+ mkdir build && cd build
92
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/c906-v226.toolchain.cmake -DCMAKE_BUILD_TYPE=release -DNCNN_OPENMP=OFF -DNCNN_THREADS=OFF -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_SIMPLEOCV=ON -DNCNN_BUILD_EXAMPLES=ON -DNCNN_BUILD_TESTS=ON ..
93
+ - name: build
94
+ run: cmake --build build -j 4
95
+
96
+ - name: test
97
+ run: |
98
+ export PATH=/data/action/osd/xuantie-qemu-x86_64-Ubuntu-18.04-20230413-0706/bin:$PATH
99
+ cd build
100
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;c906fdv" ctest --output-on-failure -j 4
101
+
102
+ linux-gcc-riscv64-rvv:
103
+ runs-on: [self-hosted, linux, centos]
104
+ steps:
105
+ - uses: actions/checkout@v4
106
+
107
+ #- name: cache-qemu
108
+ #id: cache-qemu
109
+ #uses: actions/cache@v3
110
+ #with:
111
+ #path: qemu-install
112
+ #key: qemu-riscv64-install-20220502-3
113
+ #- name: install-qemu-build-deps
114
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
115
+ #run: |
116
+ #sudo apt-get update
117
+ #sudo apt-get install autoconf automake autotools-dev ninja-build
118
+ #- name: checkout-qemu
119
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
120
+ #uses: actions/checkout@v4
121
+ #with:
122
+ #repository: qemu/qemu
123
+ #path: qemu
124
+ #ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
125
+ #- name: qemu
126
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
127
+ #run: |
128
+ #cd qemu
129
+ #wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
130
+ #patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
131
+ #./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
132
+ #make -j2
133
+ #make install
134
+
135
+ #- name: cache-riscv
136
+ #id: cache-riscv
137
+ #uses: actions/cache@v3
138
+ #with:
139
+ #path: rv64gcv-install-next
140
+ #key: rv64gcv-linux-install-20210504
141
+
142
+ #- name: install-riscv-build-deps
143
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
144
+ #run: |
145
+ #sudo apt-get update
146
+ #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
147
+
148
+ #- name: checkout-riscv-gnu-toolchain
149
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
150
+ #uses: actions/checkout@v4
151
+ #with:
152
+ #repository: riscv/riscv-gnu-toolchain
153
+ #path: riscv-gnu-toolchain
154
+ #ref: da01ba455ce3802ffa84fdca3a089079996dbfc3
155
+ #- name: checkout-riscv-gnu-toolchain-submodules
156
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
157
+ #run: |
158
+ #cd riscv-gnu-toolchain
159
+ #git submodule update --init --recursive --depth 1 glibc
160
+ #git submodule update --init --recursive --depth 1 newlib
161
+ #git submodule update --init --recursive --depth 1 riscv-binutils
162
+ #git submodule update --init --recursive --depth 1 riscv-gcc
163
+ #git submodule update --init --recursive --depth 1 riscv-dejagnu
164
+ #git submodule update --init --recursive --depth 1 riscv-gdb
165
+ #- name: riscv-gnu-toolchain
166
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
167
+ #run: |
168
+ #cd riscv-gnu-toolchain
169
+ #sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c
170
+ #./configure --prefix=$GITHUB_WORKSPACE/rv64gcv-install-next --with-arch=rv64gcv_zfh
171
+ #make linux
172
+
173
+ #- name: riscv-strip-install
174
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
175
+ #run: find $GITHUB_WORKSPACE/rv64gcv-install-next -type f | xargs -i strip -g {} || true
176
+
177
+ - name: configure
178
+ run: export RISCV_ROOT_PATH=/data/action/osd/rv64gcv-install-next && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
179
+ - name: build
180
+ run: cmake --build build -j 4
181
+
182
+ - name: test-vlen256
183
+ run: |
184
+ export PATH=/data/action/osd/qemu-install/bin:$PATH
185
+ cd build
186
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
187
+
188
+ - name: test-vlen128
189
+ run: |
190
+ export PATH=/data/action/osd/qemu-install/bin:$PATH
191
+ cd build
192
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
.github/workflows/linux-riscv64-cpu-gnu-clang.yml ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-riscv64-cpu-gnu-clang
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-riscv64-cpu-gnu-clang.yml'
7
+ - 'toolchains/riscv64-unknown-linux-gnu.llvm-toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/riscv/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/linux-riscv64-cpu-gnu-clang.yml'
18
+ - 'toolchains/riscv64-unknown-linux-gnu.llvm-toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/riscv/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: linux-riscv64-cpu-gnu-clang-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ linux-gcc-riscv64-rvv:
33
+ runs-on: [self-hosted, linux, centos]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ #- name: cache-qemu
38
+ #id: cache-qemu
39
+ #uses: actions/cache@v3
40
+ #with:
41
+ #path: qemu-install
42
+ #key: qemu-riscv64-install-20220502-3
43
+ #- name: install-qemu-build-deps
44
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
45
+ #run: |
46
+ #sudo apt-get update
47
+ #sudo apt-get install autoconf automake autotools-dev ninja-build
48
+ #- name: checkout-qemu
49
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
50
+ #uses: actions/checkout@v4
51
+ #with:
52
+ #repository: qemu/qemu
53
+ #path: qemu
54
+ #ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
55
+ #- name: qemu
56
+ #if: steps.cache-qemu.outputs.cache-hit != 'true'
57
+ #run: |
58
+ #cd qemu
59
+ #wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
60
+ #patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
61
+ #./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
62
+ #make -j2
63
+ #make install
64
+
65
+ #- name: cache-riscv
66
+ #id: cache-riscv
67
+ #uses: actions/cache@v3
68
+ #with:
69
+ #path: rv64gcv-install-next
70
+ #key: rv64gcv-linux-install-20210504
71
+
72
+ #- name: install-riscv-build-deps
73
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
74
+ #run: |
75
+ #sudo apt-get update
76
+ #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
77
+
78
+ #- name: checkout-riscv-gnu-toolchain
79
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
80
+ #uses: actions/checkout@v4
81
+ #with:
82
+ #repository: riscv/riscv-gnu-toolchain
83
+ #path: riscv-gnu-toolchain
84
+ #ref: da01ba455ce3802ffa84fdca3a089079996dbfc3
85
+ #- name: checkout-riscv-gnu-toolchain-submodules
86
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
87
+ #run: |
88
+ #cd riscv-gnu-toolchain
89
+ #git submodule update --init --recursive --depth 1 glibc
90
+ #git submodule update --init --recursive --depth 1 newlib
91
+ #git submodule update --init --recursive --depth 1 riscv-binutils
92
+ #git submodule update --init --recursive --depth 1 riscv-gcc
93
+ #git submodule update --init --recursive --depth 1 riscv-dejagnu
94
+ #git submodule update --init --recursive --depth 1 riscv-gdb
95
+ #- name: riscv-gnu-toolchain
96
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
97
+ #run: |
98
+ #cd riscv-gnu-toolchain
99
+ #sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c
100
+ #./configure --prefix=$GITHUB_WORKSPACE/rv64gcv-install-next --with-arch=rv64gcv_zfh
101
+ #make linux
102
+
103
+ #- name: riscv-strip-install
104
+ #if: steps.cache-riscv.outputs.cache-hit != 'true'
105
+ #run: find $GITHUB_WORKSPACE/rv64gcv-install-next -type f | xargs -i strip -g {} || true
106
+
107
+ # - name: install-clang
108
+ # run: |
109
+ # wget https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.1/llvm-project-15.0.1.src.tar.xz
110
+ # tar -xf llvm-project-15.0.1.src.tar.xz
111
+ # cd llvm-project-15.0.1.src
112
+ # mkdir build
113
+ # cd build
114
+ # cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="RISCV" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF ../llvm/
115
+ # make -j16
116
+ # make install
117
+
118
+ - name: build
119
+ env:
120
+ LD_LIBRARY_PATH: /data/action/install/lib64
121
+ run: |
122
+ export RISCV_ROOT_PATH=/data/action/osd/rv64gcv-install-next
123
+ export PATH=/data/action/osd/llvm-project-15.0.1.src/build/install/bin:$PATH
124
+ mkdir build && cd build
125
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.llvm-toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
126
+ cmake --build . -j 4
127
+
128
+ - name: test-vlen256
129
+ env:
130
+ LD_LIBRARY_PATH: /data/action/install/lib64
131
+ run: |
132
+ export PATH=/data/action/osd/qemu-install/bin:$PATH
133
+ cd build
134
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
135
+
136
+ - name: test-vlen128
137
+ env:
138
+ LD_LIBRARY_PATH: /data/action/install/lib64
139
+ run: |
140
+ export PATH=/data/action/osd/qemu-install/bin:$PATH
141
+ cd build
142
+ TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
.github/workflows/linux-x64-cpu-clang-python.yml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-clang-python
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-clang-python.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'python/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/linux-x64-cpu-clang-python.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/x86/**'
22
+ - 'python/**'
23
+ concurrency:
24
+ group: linux-x64-cpu-clang-python-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ linux-clang-python:
31
+ runs-on: ubuntu-20.04
32
+ strategy:
33
+ matrix:
34
+ python-version: [3.7, 3.9, 3.11]
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ with:
39
+ submodules: true
40
+ - name: set up python ${{ matrix.python-version }}
41
+ uses: actions/setup-python@v4
42
+ with:
43
+ python-version: ${{ matrix.python-version }}
44
+ - name: Install dependencies
45
+ run: |
46
+ python -m pip install --upgrade pip
47
+ pip install pytest setuptools wheel twine
48
+ - name: configure
49
+ env:
50
+ CC: clang
51
+ CXX: clang++
52
+ run: mkdir build && cd build && cmake -DNCNN_PYTHON=ON -DNCNN_DISABLE_RTTI=OFF -DNCNN_DISABLE_EXCEPTION=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
53
+ - name: build
54
+ run: cmake --build build -j 2
55
+ - name: install python
56
+ run: cd python && pip install .
57
+ - name: test
58
+ run: cd python && pytest tests
59
+ - name: build and publish
60
+ if: startsWith(github.ref, 'refs/tags')
61
+ env:
62
+ TWINE_USERNAME: __token__
63
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
64
+ TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/"
65
+ run: |
66
+ cd python
67
+ python setup.py bdist_wheel
68
+ twine upload dist/*
.github/workflows/linux-x64-cpu-clang.yml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-clang
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-clang.yml'
7
+ - 'toolchains/host-c.clang.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/linux-x64-cpu-clang.yml'
21
+ - 'toolchains/host-c.clang.toolchain.cmake'
22
+ - 'CMakeLists.txt'
23
+ - 'cmake/**'
24
+ - 'src/*'
25
+ - 'src/layer/*'
26
+ - 'src/layer/x86/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: linux-x64-cpu-clang-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ linux-clang:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - name: update
43
+ run: sudo apt-get update
44
+ - name: protobuf
45
+ run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
46
+ - name: build-sse2
47
+ env:
48
+ CC: clang
49
+ CXX: clang++
50
+ run: |
51
+ mkdir build-sse2 && cd build-sse2
52
+ cmake -DNCNN_AVX=OFF -DNCNN_AVX2=OFF -DNCNN_BUILD_TESTS=ON ..
53
+ cmake --build . -j 2
54
+ - name: test-sse2
55
+ run: cd build-sse2 && ctest --output-on-failure -j 2
56
+ - name: build-shared
57
+ env:
58
+ CC: clang
59
+ CXX: clang++
60
+ run: |
61
+ mkdir build-shared && cd build-shared
62
+ cmake -DNCNN_AVX2=ON -DNCNN_SHARED_LIB=ON ..
63
+ cmake --build . -j 2
64
+ - name: build-avx2
65
+ env:
66
+ CC: clang
67
+ CXX: clang++
68
+ run: |
69
+ mkdir build-avx2 && cd build-avx2
70
+ cmake -DNCNN_AVX2=ON -DNCNN_BUILD_TESTS=ON ..
71
+ cmake --build . -j 2
72
+ - name: test-avx2
73
+ run: cd build-avx2 && ctest --output-on-failure -j 2
74
+ - name: build-avx
75
+ env:
76
+ CC: clang
77
+ CXX: clang++
78
+ run: |
79
+ mkdir build-avx && cd build-avx
80
+ cmake -DNCNN_AVX2=OFF -DNCNN_AVX=ON -DNCNN_BUILD_TESTS=ON ..
81
+ cmake --build . -j 2
82
+ - name: test-avx
83
+ run: cd build-avx && ctest --output-on-failure -j 2
84
+ - name: build-avx1-2
85
+ env:
86
+ CC: clang
87
+ CXX: clang++
88
+ run: |
89
+ mkdir build-avx1-2 && cd build-avx1-2
90
+ cmake -DNCNN_AVX2=ON -DNCNN_AVX=ON -DNCNN_BUILD_TESTS=ON ..
91
+ cmake --build . -j 2
92
+ - name: test-avx1-2
93
+ run: cd build-avx1-2 && ctest --output-on-failure -j 2
94
+ - name: build-noint8
95
+ env:
96
+ CC: clang
97
+ CXX: clang++
98
+ run: |
99
+ mkdir build-noint8 && cd build-noint8
100
+ cmake -DNCNN_INT8=OFF -DNCNN_BUILD_TESTS=ON ..
101
+ cmake --build . -j 2
102
+ - name: test-noint8
103
+ run: cd build-noint8 && ctest --output-on-failure -j 2
104
+
105
+ linux-clang-simplestl:
106
+ runs-on: ubuntu-latest
107
+ steps:
108
+ - uses: actions/checkout@v4
109
+ - name: build-simplestl
110
+ env:
111
+ CC: clang
112
+ CXX: clang++
113
+ run: |
114
+ mkdir build-simplestl && cd build-simplestl
115
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.clang.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
116
+ cmake --build . -j 2
117
+ - name: test-simplestl
118
+ run: cd build-simplestl && ctest --output-on-failure -j 2
119
+ - name: build-simplestl-simpleomp
120
+ env:
121
+ CC: clang
122
+ CXX: clang++
123
+ run: |
124
+ mkdir build-simplestl-simpleomp && cd build-simplestl-simpleomp
125
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.clang.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_SIMPLEOMP=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
126
+ cmake --build . -j 2
127
+ - name: test-simplestl-simpleomp
128
+ run: cd build-simplestl-simpleomp && ctest --output-on-failure -j 2
.github/workflows/linux-x64-cpu-gcc-musl.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-gcc-musl
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-gcc-musl.yml'
7
+ - 'toolchains/host-c.gcc.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/linux-x64-cpu-gcc-musl.yml'
21
+ - 'toolchains/host-c.gcc.toolchain.cmake'
22
+ - 'CMakeLists.txt'
23
+ - 'cmake/**'
24
+ - 'src/*'
25
+ - 'src/layer/*'
26
+ - 'src/layer/x86/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: linux-x64-cpu-gcc-musl-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ linux-gcc-musl:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: jirutka/setup-alpine@v1
42
+ with:
43
+ packages: >
44
+ cmake
45
+ clang
46
+ clang-dev
47
+ make
48
+ gcc
49
+ g++
50
+ libc-dev
51
+ linux-headers
52
+
53
+ - uses: actions/checkout@v4
54
+ - name: build
55
+ shell: alpine.sh {0}
56
+ run: |
57
+ mkdir build && cd build
58
+ cmake -DNCNN_BUILD_TESTS=ON ..
59
+ cmake --build . -j 2
60
+ - name: test
61
+ shell: alpine.sh {0}
62
+ run: cd build && ctest --output-on-failure -j 2
63
+ - name: build-shared
64
+ run: |
65
+ mkdir build-shared && cd build-shared
66
+ cmake -DNCNN_SHARED_LIB=ON ..
67
+ cmake --build . -j 2
.github/workflows/linux-x64-cpu-gcc-san.yml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-gcc-san
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-gcc-san.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'tests/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/linux-x64-cpu-gcc-san.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/x86/**'
22
+ - 'tests/**'
23
+ concurrency:
24
+ group: linux-x64-cpu-gcc-san-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ permissions:
27
+ contents: read
28
+
29
+ jobs:
30
+ linux-gcc-san:
31
+ runs-on: ubuntu-22.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: build
35
+ run: |
36
+ mkdir build && cd build
37
+ cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_ASAN=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
38
+ cmake --build . -j 2
39
+ - name: test
40
+ run: |
41
+ cd build
42
+ ctest --output-on-failure -j 2
.github/workflows/linux-x64-cpu-gcc-sde.yml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-gcc-sde
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-gcc-sde.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'tests/**'
13
+ - 'tools/**'
14
+ - '!tools/pnnx/**'
15
+ - 'examples/**'
16
+ pull_request:
17
+ branches: [master]
18
+ paths:
19
+ - '.github/workflows/linux-x64-cpu-gcc-sde.yml'
20
+ - 'CMakeLists.txt'
21
+ - 'cmake/**'
22
+ - 'src/*'
23
+ - 'src/layer/*'
24
+ - 'src/layer/x86/**'
25
+ - 'tests/**'
26
+ - 'tools/**'
27
+ - '!tools/pnnx/**'
28
+ - 'examples/**'
29
+ concurrency:
30
+ group: linux-x64-cpu-gcc-sde-${{ github.ref }}
31
+ cancel-in-progress: true
32
+ permissions:
33
+ contents: read
34
+
35
+ jobs:
36
+ linux-gcc-sde:
37
+ runs-on: ubuntu-22.04
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - name: update
41
+ run: sudo apt-get update
42
+ - name: gcc12
43
+ run: sudo apt-get install gcc-12 g++-12
44
+ - name: Setup SDE binaries
45
+ uses: petarpetrovt/setup-sde@v2
46
+ - name: build-avx512-spr
47
+ env:
48
+ CC: gcc-12
49
+ CXX: g++-12
50
+ run: |
51
+ mkdir build-avx512-spr && cd build-avx512-spr
52
+ cmake -DNCNN_BUILD_TESTS=ON ..
53
+ cmake --build . -j 2
54
+ - name: test-avx512-spr
55
+ run: |
56
+ cd build-avx512-spr
57
+ TESTS_EXECUTABLE_LOADER=$SDE_PATH/sde64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-spr;--" ctest --output-on-failure -j 2
.github/workflows/linux-x64-cpu-gcc.yml ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-cpu-gcc.yml'
7
+ - 'toolchains/host-c.gcc.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/linux-x64-cpu-gcc.yml'
21
+ - 'toolchains/host-c.gcc.toolchain.cmake'
22
+ - 'CMakeLists.txt'
23
+ - 'cmake/**'
24
+ - 'src/*'
25
+ - 'src/layer/*'
26
+ - 'src/layer/x86/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: linux-x64-cpu-gcc-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ linux-gcc:
39
+ runs-on: ubuntu-20.04
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - name: update
43
+ run: sudo apt-get update
44
+ - name: protobuf
45
+ run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
46
+ - name: build-sse2
47
+ run: |
48
+ mkdir build-sse2 && cd build-sse2
49
+ cmake -DNCNN_AVX=OFF -DNCNN_AVX2=OFF -DNCNN_BUILD_TESTS=ON ..
50
+ cmake --build . -j 2
51
+ - name: test-sse2
52
+ run: cd build-sse2 && ctest --output-on-failure -j 2
53
+ - name: build-shared
54
+ run: |
55
+ mkdir build-shared && cd build-shared
56
+ cmake -DNCNN_AVX2=ON -DNCNN_SHARED_LIB=ON ..
57
+ cmake --build . -j 2
58
+ - name: build-avx2
59
+ run: |
60
+ mkdir build-avx2 && cd build-avx2
61
+ cmake -DNCNN_AVX2=ON -DNCNN_BUILD_TESTS=ON ..
62
+ cmake --build . -j 2
63
+ - name: test-avx2
64
+ run: cd build-avx2 && ctest --output-on-failure -j 2
65
+ - name: build-avx
66
+ run: |
67
+ mkdir build-avx && cd build-avx
68
+ cmake -DNCNN_AVX2=OFF -DNCNN_AVX=ON -DNCNN_BUILD_TESTS=ON ..
69
+ cmake --build . -j 2
70
+ - name: test-avx
71
+ run: cd build-avx && ctest --output-on-failure -j 2
72
+ - name: build-avx1-2
73
+ run: |
74
+ mkdir build-avx1-2 && cd build-avx1-2
75
+ cmake -DNCNN_AVX2=ON -DNCNN_AVX=ON -DNCNN_BUILD_TESTS=ON ..
76
+ cmake --build . -j 2
77
+ - name: test-avx1-2
78
+ run: cd build-avx1-2 && ctest --output-on-failure -j 2
79
+ - name: build-noint8
80
+ run: |
81
+ mkdir build-noint8 && cd build-noint8
82
+ cmake -DNCNN_INT8=OFF -DNCNN_BUILD_TESTS=ON ..
83
+ cmake --build . -j 2
84
+ - name: test-noint8
85
+ run: cd build-noint8 && ctest --output-on-failure -j 2
86
+
87
+ linux-gcc-cpp03-nostdio-nostring-simplestl:
88
+ runs-on: ubuntu-20.04
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - name: build-nostdio
92
+ run: |
93
+ mkdir build-nostdio && cd build-nostdio
94
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-c++03.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
95
+ cmake --build . -j 2
96
+ - name: test-nostdio
97
+ run: cd build-nostdio && ctest --output-on-failure -j 2
98
+ - name: build-nostdio-nostring
99
+ run: |
100
+ mkdir build-nostdio-nostring && cd build-nostdio-nostring
101
+ cmake -DNCNN_STDIO=OFF -DNCNN_STRING=OFF -DNCNN_BUILD_TESTS=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
102
+ cmake --build . -j 2
103
+ - name: build-simplestl
104
+ run: |
105
+ mkdir build-simplestl && cd build-simplestl
106
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.gcc.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
107
+ cmake --build . -j 2
108
+ - name: test-simplestl
109
+ run: cd build-simplestl && ctest --output-on-failure -j 2
110
+ - name: build-simplestl-simpleomp
111
+ run: |
112
+ mkdir build-simplestl-simpleomp && cd build-simplestl-simpleomp
113
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host-c.gcc.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_SIMPLEOMP=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
114
+ cmake --build . -j 2
115
+ - name: test-simplestl-simpleomp
116
+ run: cd build-simplestl-simpleomp && ctest --output-on-failure -j 2
117
+
118
+ linux-gcc-avx512:
119
+ runs-on: [self-hosted, linux, t4]
120
+ steps:
121
+ - uses: actions/checkout@v4
122
+ - name: build
123
+ env:
124
+ CC: gcc
125
+ CXX: g++
126
+ LD_LIBRARY_PATH: /data/action/install/lib64
127
+ run: |
128
+ mkdir build && cd build
129
+ cmake -DNCNN_AVX2=ON -DNCNN_AVX512=ON -DNCNN_AVX512VNNI=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
130
+ cmake --build . -j 4
131
+ - name: test
132
+ env:
133
+ LD_LIBRARY_PATH: /data/action/install/lib64
134
+ run: cd build && ctest --output-on-failure -j 4
.github/workflows/linux-x64-gpu-clang-python.yml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-gpu-clang-python
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-gpu-clang-python.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ - 'python/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/linux-x64-gpu-clang-python.yml'
18
+ - 'CMakeLists.txt'
19
+ - 'cmake/**'
20
+ - 'src/*'
21
+ - 'src/layer/*'
22
+ - 'src/layer/x86/**'
23
+ - 'src/layer/vulkan/**'
24
+ - 'python/**'
25
+ concurrency:
26
+ group: linux-x64-gpu-clang-python-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ linux-clang-gpu:
33
+ runs-on: ubuntu-20.04
34
+ strategy:
35
+ matrix:
36
+ python-version: [3.7, 3.9, 3.11]
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ with:
40
+ submodules: true
41
+ - name: cache-vulkansdk
42
+ id: cache-vulkansdk
43
+ uses: actions/cache@v3
44
+ with:
45
+ path: "1.3.236.0"
46
+ key: vulkansdk-linux-x86_64-1.3.236.0
47
+ - name: vulkansdk
48
+ if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
49
+ run: |
50
+ wget https://sdk.lunarg.com/sdk/download/1.3.236.0/linux/vulkansdk-linux-x86_64-1.3.236.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.3.236.0.tar.gz
51
+ tar -xf vulkansdk-linux-x86_64-1.3.236.0.tar.gz
52
+ rm -rf 1.3.236.0/source 1.3.236.0/samples
53
+ find 1.3.236.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
54
+ - name: cache-swiftshader
55
+ id: cache-swiftshader
56
+ uses: actions/cache@v3
57
+ with:
58
+ path: swiftshader-install
59
+ key: swiftshader-linux-install-20230420
60
+ - name: checkout-swiftshader
61
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
62
+ uses: actions/checkout@v4
63
+ with:
64
+ repository: google/swiftshader
65
+ path: swiftshader
66
+ ref: dd55e592406dc0bae219df11adec6363840aff4a
67
+ - name: checkout-swiftshader-submodules
68
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
69
+ run: |
70
+ cd swiftshader
71
+ git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive
72
+ - name: swiftshader
73
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
74
+ run: |
75
+ cd swiftshader
76
+ mkdir -p build; cd build
77
+ cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_EGL=FALSE -DSWIFTSHADER_BUILD_GLESv2=FALSE -DSWIFTSHADER_BUILD_GLES_CM=FALSE -DSWIFTSHADER_BUILD_VULKAN=TRUE -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release ..
78
+ cmake --build . -j 2
79
+ mkdir $GITHUB_WORKSPACE/swiftshader-install
80
+ cp Linux/* $GITHUB_WORKSPACE/swiftshader-install
81
+ - name: set up python ${{ matrix.python-version }}
82
+ uses: actions/setup-python@v4
83
+ with:
84
+ python-version: ${{ matrix.python-version }}
85
+ - name: Install dependencies
86
+ run: |
87
+ python -m pip install --upgrade pip
88
+ pip install pytest setuptools wheel twine
89
+ - name: build
90
+ env:
91
+ CC: clang
92
+ CXX: clang++
93
+ run: |
94
+ export VULKAN_SDK=`pwd`/1.3.236.0/x86_64
95
+ mkdir build && cd build
96
+ cmake -DNCNN_VULKAN=ON -DNCNN_PYTHON=ON -DNCNN_DISABLE_RTTI=OFF -DNCNN_DISABLE_EXCEPTION=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
97
+ cmake --build . -j 2
98
+ - name: install python
99
+ run: cd python && pip install .
100
+ - name: test
101
+ run: |
102
+ export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json"
103
+ cd python && pytest tests
104
+ - name: build and publish
105
+ if: startsWith(github.ref, 'refs/tags')
106
+ env:
107
+ TWINE_USERNAME: __token__
108
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
109
+ TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/"
110
+ run: |
111
+ cd python
112
+ python setup.py bdist_wheel
113
+ twine upload dist/*
.github/workflows/linux-x64-gpu-clang.yml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-gpu-clang
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-gpu-clang.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/linux-x64-gpu-clang.yml'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/x86/**'
26
+ - 'src/layer/vulkan/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: linux-x64-gpu-clang-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ linux-clang-gpu:
39
+ runs-on: [self-hosted, linux, cvm]
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ submodules: true
44
+ - name: cache-swiftshader
45
+ id: cache-swiftshader
46
+ uses: actions/cache@v3
47
+ with:
48
+ path: swiftshader-install
49
+ key: swiftshader-linux-install-20230420
50
+ - name: checkout-swiftshader
51
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: google/swiftshader
55
+ path: swiftshader
56
+ ref: dd55e592406dc0bae219df11adec6363840aff4a
57
+ - name: checkout-swiftshader-submodules
58
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd swiftshader
61
+ git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive
62
+ - name: swiftshader
63
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
64
+ run: |
65
+ cd swiftshader
66
+ mkdir -p build; cd build
67
+ cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_EGL=FALSE -DSWIFTSHADER_BUILD_GLESv2=FALSE -DSWIFTSHADER_BUILD_GLES_CM=FALSE -DSWIFTSHADER_BUILD_VULKAN=TRUE -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release ..
68
+ cmake --build . -j 4
69
+ mkdir $GITHUB_WORKSPACE/swiftshader-install
70
+ cp Linux/* $GITHUB_WORKSPACE/swiftshader-install
71
+ - name: build
72
+ env:
73
+ CC: clang
74
+ CXX: clang++
75
+ run: |
76
+ mkdir build && cd build
77
+ cmake -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON ..
78
+ cmake --build . -j 4
79
+ - name: test
80
+ run: |
81
+ printf "[Processor]\nThreadCount=1\n" > build/tests/SwiftShader.ini
82
+ export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json"
83
+ cd build && ctest --output-on-failure -j 4
84
+ - name: build-shared
85
+ env:
86
+ CC: clang
87
+ CXX: clang++
88
+ run: |
89
+ mkdir build-shared && cd build-shared
90
+ cmake -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
91
+ cmake --build . -j 4
.github/workflows/linux-x64-gpu-gcc.yml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x64-gpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x64-gpu-gcc.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/linux-x64-gpu-gcc.yml'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/x86/**'
26
+ - 'src/layer/vulkan/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: linux-x64-gpu-gcc-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ permissions:
35
+ contents: read
36
+
37
+ jobs:
38
+ linux-gcc-gpu:
39
+ runs-on: [self-hosted, linux, cvm]
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ submodules: true
44
+ - name: cache-swiftshader
45
+ id: cache-swiftshader
46
+ uses: actions/cache@v3
47
+ with:
48
+ path: swiftshader-install
49
+ key: swiftshader-linux-install-20230420
50
+ - name: checkout-swiftshader
51
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
52
+ uses: actions/checkout@v4
53
+ with:
54
+ repository: google/swiftshader
55
+ path: swiftshader
56
+ ref: dd55e592406dc0bae219df11adec6363840aff4a
57
+ - name: checkout-swiftshader-submodules
58
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd swiftshader
61
+ git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive
62
+ - name: swiftshader
63
+ if: steps.cache-swiftshader.outputs.cache-hit != 'true'
64
+ run: |
65
+ cd swiftshader
66
+ mkdir -p build; cd build
67
+ cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_EGL=FALSE -DSWIFTSHADER_BUILD_GLESv2=FALSE -DSWIFTSHADER_BUILD_GLES_CM=FALSE -DSWIFTSHADER_BUILD_VULKAN=TRUE -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release ..
68
+ cmake --build . -j 4
69
+ mkdir $GITHUB_WORKSPACE/swiftshader-install
70
+ cp Linux/* $GITHUB_WORKSPACE/swiftshader-install
71
+ - name: build
72
+ run: |
73
+ mkdir build && cd build
74
+ cmake -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON ..
75
+ cmake --build . -j 4
76
+ - name: test
77
+ run: |
78
+ printf "[Processor]\nThreadCount=1\n" > build/tests/SwiftShader.ini
79
+ export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json"
80
+ cd build && ctest --output-on-failure -j 4
81
+ - name: build-shared
82
+ run: |
83
+ mkdir build-shared && cd build-shared
84
+ cmake -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
85
+ cmake --build . -j 4
86
+
87
+ linux-gcc-gpu-system-glslang:
88
+ runs-on: ubuntu-20.04
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+
92
+ - name: install-deps
93
+ run: |
94
+ sudo apt-get update
95
+ sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev libvulkan-dev glslang-dev spirv-tools
96
+
97
+ - name: build
98
+ run: |
99
+ mkdir build && cd build
100
+ cmake -DNCNN_VULKAN=ON -DNCNN_SYSTEM_GLSLANG=ON -DGLSLANG_TARGET_DIR=/usr/lib/x86_64-linux-gnu/cmake ..
101
+ cmake --build . -j 4
102
+ - name: build-shared
103
+ run: |
104
+ mkdir build-shared && cd build-shared
105
+ cmake -DNCNN_VULKAN=ON -DNCNN_SYSTEM_GLSLANG=ON -DGLSLANG_TARGET_DIR=/usr/lib/x86_64-linux-gnu/cmake -DNCNN_SHARED_LIB=ON ..
106
+ cmake --build . -j 4
107
+
108
+ linux-gcc-gpu-t4:
109
+ runs-on: [self-hosted, linux, t4]
110
+ steps:
111
+ - uses: actions/checkout@v4
112
+ with:
113
+ submodules: true
114
+ - name: build
115
+ env:
116
+ CC: gcc
117
+ CXX: g++
118
+ LD_LIBRARY_PATH: /data/action/install/lib64
119
+ run: |
120
+ export VULKAN_SDK=/data/action/osd/1.2.189.0/x86_64
121
+ mkdir build && cd build
122
+ cmake -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
123
+ cmake --build . -j 4
124
+ - name: test
125
+ env:
126
+ LD_LIBRARY_PATH: /data/action/install/lib64
127
+ run: |
128
+ cd build && ctest --output-on-failure -j 4
.github/workflows/linux-x86-cpu-clang.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x86-cpu-clang
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x86-cpu-clang.yml'
7
+ - 'toolchains/host.clang-m32.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/linux-x86-cpu-clang.yml'
18
+ - 'toolchains/host.clang-m32.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/x86/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: linux-x86-cpu-clang-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ linux-clang:
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - name: update
37
+ run: sudo apt-get update
38
+ - name: gcc-multilib
39
+ run: sudo apt-get install gcc-multilib g++-multilib
40
+ - name: build
41
+ env:
42
+ CC: clang
43
+ CXX: clang++
44
+ run: |
45
+ mkdir build && cd build
46
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.clang-m32.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
47
+ cmake --build . -j 2
48
+ - name: test
49
+ run: cd build && ctest --output-on-failure -j 2
50
+ - name: build-shared
51
+ env:
52
+ CC: clang
53
+ CXX: clang++
54
+ run: |
55
+ mkdir build-shared && cd build-shared
56
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.clang-m32.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_SHARED_LIB=ON ..
57
+ cmake --build . -j 2
58
+ - name: build-noint8
59
+ env:
60
+ CC: clang
61
+ CXX: clang++
62
+ run: |
63
+ mkdir build-noint8 && cd build-noint8
64
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.clang-m32.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_INT8=OFF ..
65
+ cmake --build . -j 2
66
+ - name: test-noint8
67
+ run: cd build-noint8 && ctest --output-on-failure -j 2
.github/workflows/linux-x86-cpu-gcc.yml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: linux-x86-cpu-gcc
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/linux-x86-cpu-gcc.yml'
7
+ - 'toolchains/host.gcc-m32.toolchain.cmake'
8
+ - 'CMakeLists.txt'
9
+ - 'cmake/**'
10
+ - 'src/*'
11
+ - 'src/layer/*'
12
+ - 'src/layer/x86/**'
13
+ - 'tests/**'
14
+ pull_request:
15
+ branches: [master]
16
+ paths:
17
+ - '.github/workflows/linux-x86-cpu-gcc.yml'
18
+ - 'toolchains/host.gcc-m32.toolchain.cmake'
19
+ - 'CMakeLists.txt'
20
+ - 'cmake/**'
21
+ - 'src/*'
22
+ - 'src/layer/*'
23
+ - 'src/layer/x86/**'
24
+ - 'tests/**'
25
+ concurrency:
26
+ group: linux-x86-cpu-gcc-${{ github.ref }}
27
+ cancel-in-progress: true
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ linux-gcc:
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - name: update
37
+ run: sudo apt-get update
38
+ - name: gcc-multilib
39
+ run: sudo apt-get install gcc-multilib g++-multilib
40
+ - name: build
41
+ run: |
42
+ mkdir build && cd build
43
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-m32.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
44
+ cmake --build . -j 2
45
+ - name: test
46
+ run: cd build && ctest --output-on-failure -j 2
47
+ - name: build-nosse
48
+ run: |
49
+ mkdir build-nosse && cd build-nosse
50
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-m32.toolchain.cmake -DNCNN_RUNTIME_CPU=OFF -DNCNN_SSE2=OFF -DNCNN_AVX=OFF -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
51
+ cmake --build . -j 2
52
+ - name: test-nosse
53
+ run: cd build-nosse && ctest --output-on-failure -j 2
54
+ - name: build-shared
55
+ run: |
56
+ mkdir build-shared && cd build-shared
57
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-m32.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_SHARED_LIB=ON ..
58
+ cmake --build . -j 2
59
+ - name: build-noint8
60
+ run: |
61
+ mkdir build-noint8 && cd build-noint8
62
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc-m32.toolchain.cmake -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_INT8=OFF ..
63
+ cmake --build . -j 2
64
+ - name: test-noint8
65
+ run: cd build-noint8 && ctest --output-on-failure -j 2
.github/workflows/mac-catalyst-arm64-cpu.yml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: mac-catalyst-arm64-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/mac-catalyst-arm64-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ pull_request:
13
+ branches: [master]
14
+ paths:
15
+ - '.github/workflows/mac-catalyst-arm64-cpu.yml'
16
+ - 'CMakeLists.txt'
17
+ - 'cmake/**'
18
+ - 'src/*'
19
+ - 'src/layer/*'
20
+ - 'src/layer/arm/**'
21
+ concurrency:
22
+ group: mac-catalyst-arm64-cpu-${{ github.ref }}
23
+ cancel-in-progress: true
24
+ env:
25
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
26
+ MAC_CATALYST_DEPLOYMENT_TARGET: '13.1'
27
+ ENABLE_BITCODE: OFF
28
+ ENABLE_ARC: OFF
29
+ ENABLE_VISIBILITY: OFF
30
+ permissions:
31
+ contents: read
32
+
33
+ jobs:
34
+ mac-catalyst-clang:
35
+ runs-on: macos-12
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: cache-openmp
40
+ id: cache-openmp
41
+ uses: actions/cache@v3
42
+ with:
43
+ path: openmp-install
44
+ key: openmp-mac-catalyst-install-20230504
45
+ - name: openmp
46
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
47
+ run: |
48
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
49
+ tar -xf openmp-11.0.0.src.tar.xz
50
+ cd openmp-11.0.0.src
51
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
52
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
53
+ - name: openmp-build-x86_64
54
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
55
+ run: |
56
+ cd openmp-11.0.0.src
57
+ mkdir -p build-x86_64 && cd build-x86_64
58
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
59
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
60
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
61
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
62
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
63
+ cmake --build . -j 3
64
+ cmake --build . --target install
65
+ - name: openmp-build-arm64
66
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
67
+ run: |
68
+ cd openmp-11.0.0.src
69
+ mkdir -p build-arm64 && cd build-arm64
70
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
71
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
72
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
73
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
74
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
75
+ cmake --build . -j 3
76
+ cmake --build . --target install
77
+ - name: openmp-merge-fat-library
78
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
79
+ run: |
80
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
81
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
82
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
83
+ lipo -create \
84
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
85
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
86
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
87
+
88
+ - name: install-openmp
89
+ run: |
90
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
91
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
92
+
93
+ - name: build
94
+ run: |
95
+ mkdir build && cd build
96
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
97
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
98
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
99
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
100
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \
101
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
102
+ -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
103
+ cmake --build . -j 3
.github/workflows/mac-catalyst-arm64-gpu.yml ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: mac-catalyst-arm64-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/mac-catalyst-arm64-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/arm/**'
12
+ - 'src/layer/vulkan/**'
13
+ pull_request:
14
+ branches: [master]
15
+ paths:
16
+ - '.github/workflows/mac-catalyst-arm64-gpu.yml'
17
+ - 'CMakeLists.txt'
18
+ - 'cmake/**'
19
+ - 'src/*'
20
+ - 'src/layer/*'
21
+ - 'src/layer/arm/**'
22
+ - 'src/layer/vulkan/**'
23
+ concurrency:
24
+ group: mac-catalyst-arm64-gpu-${{ github.ref }}
25
+ cancel-in-progress: true
26
+ env:
27
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
28
+ MAC_CATALYST_DEPLOYMENT_TARGET: '13.1'
29
+ ENABLE_BITCODE: OFF
30
+ ENABLE_ARC: OFF
31
+ ENABLE_VISIBILITY: OFF
32
+ permissions:
33
+ contents: read
34
+
35
+ jobs:
36
+ mac-catalyst-clang-gpu:
37
+ runs-on: macos-12
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ with:
41
+ submodules: true
42
+
43
+ - name: cache-openmp
44
+ id: cache-openmp
45
+ uses: actions/cache@v3
46
+ with:
47
+ path: openmp-install
48
+ key: openmp-mac-catalyst-install-20230504
49
+ - name: openmp
50
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
51
+ run: |
52
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
53
+ tar -xf openmp-11.0.0.src.tar.xz
54
+ cd openmp-11.0.0.src
55
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
56
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
57
+ - name: openmp-build-x86_64
58
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
59
+ run: |
60
+ cd openmp-11.0.0.src
61
+ mkdir -p build-x86_64 && cd build-x86_64
62
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
63
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
64
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
65
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
66
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
67
+ cmake --build . -j 3
68
+ cmake --build . --target install
69
+ - name: openmp-build-arm64
70
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
71
+ run: |
72
+ cd openmp-11.0.0.src
73
+ mkdir -p build-arm64 && cd build-arm64
74
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
75
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
76
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
77
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
78
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
79
+ cmake --build . -j 3
80
+ cmake --build . --target install
81
+ - name: openmp-merge-fat-library
82
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
83
+ run: |
84
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
85
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
86
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
87
+ lipo -create \
88
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
89
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
90
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
91
+
92
+ - name: install-openmp
93
+ run: |
94
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
95
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
96
+
97
+ - name: vulkansdk
98
+ run: |
99
+ wget https://sdk.lunarg.com/sdk/download/1.3.236.0/mac/vulkansdk-macos-1.3.236.0.dmg?Human=true -O vulkansdk-macos-1.3.236.0.dmg
100
+ hdiutil attach vulkansdk-macos-1.3.236.0.dmg
101
+ sudo /Volumes/vulkansdk-macos-1.3.236.0/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0 --accept-licenses --default-answer --confirm-command install
102
+ hdiutil detach /Volumes/vulkansdk-macos-1.3.236.0
103
+
104
+ - name: build
105
+ run: |
106
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
107
+ mkdir build && cd build
108
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
109
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
110
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
111
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
112
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \
113
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
114
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/macOS/libMoltenVK.dylib \
115
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
116
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
117
+ cmake --build . -j 3
.github/workflows/mac-catalyst-x64-cpu.yml ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: mac-catalyst-x64-cpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/mac-catalyst-x64-cpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'tests/**'
13
+ - 'tools/**'
14
+ - '!tools/pnnx/**'
15
+ - 'examples/**'
16
+ pull_request:
17
+ branches: [master]
18
+ paths:
19
+ - '.github/workflows/mac-catalyst-x64-cpu.yml'
20
+ - 'CMakeLists.txt'
21
+ - 'cmake/**'
22
+ - 'src/*'
23
+ - 'src/layer/*'
24
+ - 'src/layer/x86/**'
25
+ - 'tests/**'
26
+ - 'tools/**'
27
+ - '!tools/pnnx/**'
28
+ - 'examples/**'
29
+ concurrency:
30
+ group: mac-catalyst-x64-cpu-${{ github.ref }}
31
+ cancel-in-progress: true
32
+ env:
33
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
34
+ MAC_CATALYST_DEPLOYMENT_TARGET: '13.1'
35
+ ENABLE_BITCODE: OFF
36
+ ENABLE_ARC: OFF
37
+ ENABLE_VISIBILITY: OFF
38
+ permissions:
39
+ contents: read
40
+
41
+ jobs:
42
+ mac-catalyst-clang:
43
+ runs-on: macos-12
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - name: cache-openmp
48
+ id: cache-openmp
49
+ uses: actions/cache@v3
50
+ with:
51
+ path: openmp-install
52
+ key: openmp-mac-catalyst-install-20230504
53
+ - name: openmp
54
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
55
+ run: |
56
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
57
+ tar -xf openmp-11.0.0.src.tar.xz
58
+ cd openmp-11.0.0.src
59
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
60
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
61
+ - name: openmp-build-x86_64
62
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
63
+ run: |
64
+ cd openmp-11.0.0.src
65
+ mkdir -p build-x86_64 && cd build-x86_64
66
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
67
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
68
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
69
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
70
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
71
+ cmake --build . -j 3
72
+ cmake --build . --target install
73
+ - name: openmp-build-arm64
74
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
75
+ run: |
76
+ cd openmp-11.0.0.src
77
+ mkdir -p build-arm64 && cd build-arm64
78
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
79
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
80
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
81
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
82
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
83
+ cmake --build . -j 3
84
+ cmake --build . --target install
85
+ - name: openmp-merge-fat-library
86
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
87
+ run: |
88
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
89
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
90
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
91
+ lipo -create \
92
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
93
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
94
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
95
+
96
+ - name: install-openmp
97
+ run: |
98
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
99
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
100
+
101
+ - name: build
102
+ run: |
103
+ mkdir build && cd build
104
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
105
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
106
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
107
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
108
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \
109
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
110
+ ..
111
+ cmake --build . -j 3
.github/workflows/mac-catalyst-x64-gpu.yml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: mac-catalyst-x64-gpu
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ paths:
6
+ - '.github/workflows/mac-catalyst-x64-gpu.yml'
7
+ - 'CMakeLists.txt'
8
+ - 'cmake/**'
9
+ - 'src/*'
10
+ - 'src/layer/*'
11
+ - 'src/layer/x86/**'
12
+ - 'src/layer/vulkan/**'
13
+ - 'tests/**'
14
+ - 'tools/**'
15
+ - '!tools/pnnx/**'
16
+ - 'examples/**'
17
+ pull_request:
18
+ branches: [master]
19
+ paths:
20
+ - '.github/workflows/mac-catalyst-x64-gpu.yml'
21
+ - 'CMakeLists.txt'
22
+ - 'cmake/**'
23
+ - 'src/*'
24
+ - 'src/layer/*'
25
+ - 'src/layer/x86/**'
26
+ - 'src/layer/vulkan/**'
27
+ - 'tests/**'
28
+ - 'tools/**'
29
+ - '!tools/pnnx/**'
30
+ - 'examples/**'
31
+ concurrency:
32
+ group: mac-catalyst-x64-gpu-${{ github.ref }}
33
+ cancel-in-progress: true
34
+ env:
35
+ DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer
36
+ MAC_CATALYST_DEPLOYMENT_TARGET: '13.1'
37
+ ENABLE_BITCODE: OFF
38
+ ENABLE_ARC: OFF
39
+ ENABLE_VISIBILITY: OFF
40
+ permissions:
41
+ contents: read
42
+
43
+ jobs:
44
+ mac-catalyst-clang-gpu:
45
+ runs-on: macos-12
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ submodules: true
50
+
51
+ - name: cache-openmp
52
+ id: cache-openmp
53
+ uses: actions/cache@v3
54
+ with:
55
+ path: openmp-install
56
+ key: openmp-mac-catalyst-install-20230504
57
+ - name: openmp
58
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
59
+ run: |
60
+ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz
61
+ tar -xf openmp-11.0.0.src.tar.xz
62
+ cd openmp-11.0.0.src
63
+ sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S
64
+ sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S
65
+ - name: openmp-build-x86_64
66
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
67
+ run: |
68
+ cd openmp-11.0.0.src
69
+ mkdir -p build-x86_64 && cd build-x86_64
70
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
71
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
72
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
73
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
74
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
75
+ cmake --build . -j 3
76
+ cmake --build . --target install
77
+ - name: openmp-build-arm64
78
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
79
+ run: |
80
+ cd openmp-11.0.0.src
81
+ mkdir -p build-arm64 && cd build-arm64
82
+ cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST_ARM64 -DARCHS="arm64" \
83
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
84
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
85
+ -DPERL_EXECUTABLE=/usr/local/bin/perl \
86
+ -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF ..
87
+ cmake --build . -j 3
88
+ cmake --build . --target install
89
+ - name: openmp-merge-fat-library
90
+ if: steps.cache-openmp.outputs.cache-hit != 'true'
91
+ run: |
92
+ mkdir -p $GITHUB_WORKSPACE/openmp-install
93
+ cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install
94
+ mkdir -p $GITHUB_WORKSPACE/openmp-install/lib
95
+ lipo -create \
96
+ openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \
97
+ openmp-11.0.0.src/build-arm64/install/lib/libomp.a \
98
+ -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a
99
+
100
+ - name: install-openmp
101
+ run: |
102
+ sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
103
+ sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
104
+
105
+ - name: vulkansdk
106
+ run: |
107
+ wget https://sdk.lunarg.com/sdk/download/1.3.236.0/mac/vulkansdk-macos-1.3.236.0.dmg?Human=true -O vulkansdk-macos-1.3.236.0.dmg
108
+ hdiutil attach vulkansdk-macos-1.3.236.0.dmg
109
+ sudo /Volumes/vulkansdk-macos-1.3.236.0/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0 --accept-licenses --default-answer --confirm-command install
110
+ hdiutil detach /Volumes/vulkansdk-macos-1.3.236.0
111
+
112
+ - name: build
113
+ run: |
114
+ export VULKAN_SDK=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/macOS
115
+ mkdir build && cd build
116
+ cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_CATALYST -DARCHS="x86_64" \
117
+ -DDEPLOYMENT_TARGET=$MAC_CATALYST_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \
118
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
119
+ -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \
120
+ -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \
121
+ -DVulkan_INCLUDE_DIR=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/include \
122
+ -DVulkan_LIBRARY=$GITHUB_WORKSPACE/vulkansdk-macos-1.3.236.0/MoltenVK/dylib/macOS/libMoltenVK.dylib \
123
+ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \
124
+ -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF ..
125
+ cmake --build . -j 3