forked from Tencent/ncnn
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 2.65 KB
/
linux-x64-gpu-clang.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: linux-x64-gpu-clang
on: [push, pull_request]
jobs:
linux-clang-gpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: update
run: sudo apt-get update
- name: protobuf
run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "1.1.114.0"
key: vulkansdk-linux-x86_64-1.1.114.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.1.114.0/linux/vulkansdk-linux-x86_64-1.1.114.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.1.114.0.tar.gz
tar -xf vulkansdk-linux-x86_64-1.1.114.0.tar.gz
rm -rf 1.1.114.0/source 1.1.114.0/samples
find 1.1.114.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
- name: cache-swiftshader
id: cache-swiftshader
uses: actions/cache@v1
with:
path: swiftshader-install
key: swiftshader-linux-install-20200508
- name: checkout-swiftshader
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: google/swiftshader
path: swiftshader
ref: 2dd864470e310d173d35fa95ca3a14d216734aab
- name: checkout-swiftshader-submodules
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
cd swiftshader
git submodule update --init --recursive
- name: swiftshader
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
cd swiftshader
mkdir -p build; cd build
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 -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 2
mkdir $GITHUB_WORKSPACE/swiftshader-install
cp Linux/* $GITHUB_WORKSPACE/swiftshader-install
- name: configure
env:
CC: clang
CXX: clang++
run: export VULKAN_SDK=`pwd`/1.1.114.0/x86_64 && mkdir build && cd build && cmake -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: test
run: |
export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json"
cd build && ctest --output-on-failure -j 2