Skip to content

Commit

Permalink
Merge pull request #5 from Tencent/master
Browse files Browse the repository at this point in the history
merge ncnn
  • Loading branch information
tpoisonooo authored Dec 28, 2019
2 parents ad69514 + 0717054 commit d37df2b
Show file tree
Hide file tree
Showing 102 changed files with 6,523 additions and 2,822 deletions.
365 changes: 365 additions & 0 deletions .github/workflows/ccpp.yml
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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ matrix:
- BEFORE_BUILD="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"
- BUILD="export VULKAN_SDK=`pwd`/1.1.92.1/x86_64 && mkdir build && cd build && cmake -DNCNN_VULKAN=ON .. && make -j2"

- name: "linux-mips-mti"
os: linux
dist: bionic
env:
- NAME=linux-mips-mti
- BEFORE_BUILD="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"
- BUILD="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 .. && make -j2"

- name: "macos-clang"
os: osx
osx_image: xcode9.4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
endif()
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")

cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 2.8.12)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE release CACHE STRING "Choose the type of build" FORCE)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ncnn 是一个为手机端极致优化的高性能神经网络前向计算框架
| :---: | :---: | :---: | :--: | :--: |
| Linux (GCC) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=linux-gcc&label=build)](https://travis-ci.org/Tencent/ncnn) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=linux-gcc-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) |
| Linux (Clang) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=linux-clang&label=build)](https://travis-ci.org/Tencent/ncnn) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=linux-clang-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) |
| Linux (MIPS) | [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=linux-mips-mti&label=build)](https://travis-ci.org/Tencent/ncnn) ||||
| Windows (VS2017) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=windows-vs2017&label=build)](https://travis-ci.org/Tencent/ncnn) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=windows-vs2017-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) |
| MacOS || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=macos-clang&label=build)](https://travis-ci.org/Tencent/ncnn) || [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=macos-clang-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) |
| Android | [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=android-armv7&label=build)](https://travis-ci.org/Tencent/ncnn) | [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=android-armv7-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) | [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=android-aarch64&label=build)](https://travis-ci.org/Tencent/ncnn) | [![Build Status](https://badges.herokuapp.com/travis/Tencent/ncnn?env=NAME=android-aarch64-gpu&label=build)](https://travis-ci.org/Tencent/ncnn) |
Expand Down
Loading

0 comments on commit d37df2b

Please sign in to comment.