-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Tencent/master
merge ncnn
- Loading branch information
Showing
102 changed files
with
6,523 additions
and
2,822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,365 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
linux-gcc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: sudo apt-get install libprotobuf-dev protobuf-compiler | ||
- name: configure | ||
run: mkdir build && cd build && cmake .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
linux-gcc-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: sudo apt-get install libprotobuf-dev protobuf-compiler | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export VULKAN_SDK=`pwd`/1.1.92.1/x86_64 && mkdir build && cd build && cmake -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
linux-clang: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: sudo apt-get install libprotobuf-dev protobuf-compiler | ||
- name: configure | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
run: mkdir build && cd build && cmake .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
linux-clang-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: sudo apt-get install libprotobuf-dev protobuf-compiler | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
run: export VULKAN_SDK=`pwd`/1.1.92.1/x86_64 && mkdir build && cd build && cmake -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
linux-mips-mti: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: mips-mti-compiler | ||
run: | | ||
wget https://codescape.mips.com/components/toolchain/2019.09-01/Codescape.GNU.Tools.Package.2019.09-01.for.MIPS.MTI.Linux.CentOS-6.x86_64.tar.gz -O mips-mti-linux-gnu.tar.gz | ||
tar -zxf mips-mti-linux-gnu.tar.gz | ||
- name: configure | ||
run: | | ||
export PATH=`pwd`/mips-mti-linux-gnu/2019.09-01/bin:$PATH | ||
mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips-mti-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
macos-clang: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: brew install protobuf | ||
- name: configure | ||
run: mkdir build && cd build && cmake .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
macos-clang-gpu: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: protobuf | ||
run: brew install protobuf | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "vulkansdk-macos-1.1.92.1" | ||
key: vulkansdk-macos-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/mac/vulkansdk-macos-1.1.92.1.tar.gz?Human=true -O vulkansdk-macos-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-macos-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export VULKAN_SDK=`pwd`/vulkansdk-macos-1.1.92.1/macOS && mkdir build && cd build && cmake -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
windows-vs2019: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-protobuf | ||
id: cache-protobuf | ||
uses: actions/cache@v1 | ||
with: | ||
path: "protobuf-3.11.2" | ||
key: protobuf-3.11.2-build-vs2019-install | ||
- name: protobuf | ||
if: steps.cache-protobuf.outputs.cache-hit != 'true' | ||
run: | | ||
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/archive/v3.11.2.zip -OutFile protobuf-3.11.2.zip | ||
7z x ./protobuf-3.11.2.zip | ||
cd protobuf-3.11.2 | ||
mkdir build-vs2019; cd build-vs2019; cmake -DCMAKE_INSTALL_PREFIX=install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake | ||
cmake --build . --config Release -j 2 | ||
cmake --build . --config Release --target install | ||
- name: configure | ||
run: | | ||
$Protobuf_LIBRARIES = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\lib\libprotobuf.lib' | ||
$Protobuf_INCLUDE_DIR = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\include' | ||
$Protobuf_PROTOC_EXECUTABLE = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\bin\protoc.exe' | ||
mkdir build | ||
cd build | ||
cmake -DProtobuf_INCLUDE_DIR="$Protobuf_INCLUDE_DIR" -DProtobuf_LIBRARIES="$Protobuf_LIBRARIES" -DProtobuf_PROTOC_EXECUTABLE="$Protobuf_PROTOC_EXECUTABLE" .. | ||
- name: build | ||
run: cmake --build build --config Release -j 2 | ||
|
||
windows-vs2019-gpu: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-protobuf | ||
id: cache-protobuf | ||
uses: actions/cache@v1 | ||
with: | ||
path: "protobuf-3.11.2" | ||
key: protobuf-3.11.2-build-vs2019-install | ||
- name: protobuf | ||
if: steps.cache-protobuf.outputs.cache-hit != 'true' | ||
run: | | ||
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/archive/v3.11.2.zip -OutFile protobuf-3.11.2.zip | ||
7z x ./protobuf-3.11.2.zip | ||
cd protobuf-3.11.2 | ||
mkdir build-vs2019; cd build-vs2019; cmake -DCMAKE_INSTALL_PREFIX=install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake | ||
cmake --build . --config Release -j 2 | ||
cmake --build . --config Release --target install | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "VulkanSDK" | ||
key: VulkanSDK-1.1.92.1-Installer | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.1.92.1/windows/VulkanSDK-1.1.92.1-Installer.exe?Human=true -OutFile VulkanSDK-1.1.92.1-Installer.exe | ||
7z x ./VulkanSDK-1.1.92.1-Installer.exe -oVulkanSDK | ||
- name: configure | ||
run: | | ||
$env:VULKAN_SDK="$(pwd)/VulkanSDK" | ||
$Protobuf_LIBRARIES = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\lib\libprotobuf.lib' | ||
$Protobuf_INCLUDE_DIR = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\include' | ||
$Protobuf_PROTOC_EXECUTABLE = Resolve-Path 'protobuf-3.11.2\build-vs2019\install\bin\protoc.exe' | ||
mkdir build | ||
cd build | ||
cmake -DProtobuf_INCLUDE_DIR="$Protobuf_INCLUDE_DIR" -DProtobuf_LIBRARIES="$Protobuf_LIBRARIES" -DProtobuf_PROTOC_EXECUTABLE="$Protobuf_PROTOC_EXECUTABLE" -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build --config Release -j 2 | ||
|
||
android-armv7: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-armv7-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export PATH=`pwd`/1.1.92.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-aarch64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-aarch64-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export PATH=`pwd`/1.1.92.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-x86: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-14 .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-x86-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export PATH=`pwd`/1.1.92.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-x86_64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
android-x86_64-gpu: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "1.1.92.1" | ||
key: vulkansdk-linux-x86_64-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/linux/vulkansdk-linux-x86_64-1.1.92.1.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-linux-x86_64-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export PATH=`pwd`/1.1.92.1/x86_64/bin:$PATH && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
ios-iphoneos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DIOS_PLATFORM=OS .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
ios-iphoneos-gpu: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: cache-vulkansdk | ||
id: cache-vulkansdk | ||
uses: actions/cache@v1 | ||
with: | ||
path: "vulkansdk-macos-1.1.92.1" | ||
key: vulkansdk-macos-1.1.92.1 | ||
- name: vulkansdk | ||
if: steps.cache-vulkansdk.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://sdk.lunarg.com/sdk/download/1.1.92.1/mac/vulkansdk-macos-1.1.92.1.tar.gz?Human=true -O vulkansdk-macos-1.1.92.1.tar.gz | ||
tar -xf vulkansdk-macos-1.1.92.1.tar.gz | ||
- name: configure | ||
run: export VULKAN_SDK=`pwd`/vulkansdk-macos-1.1.92.1/macOS && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DIOS_PLATFORM=OS64 -DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.1.92.1/MoltenVK/include -DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.1.92.1/MoltenVK/iOS/dynamic/libMoltenVK.dylib -DNCNN_VULKAN=ON .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
ios-iphonesimulator: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: configure | ||
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR .. | ||
- name: build | ||
run: cmake --build build -j 2 | ||
|
||
webassembly: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: emsdk | ||
run: | | ||
git clone https://github.com/emscripten-core/emsdk.git | ||
cd emsdk | ||
./emsdk install latest | ||
./emsdk activate latest | ||
- name: configure | ||
run: source emsdk/emsdk_env.sh && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake .. | ||
- name: build | ||
run: cmake --build build -j 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.