-
Notifications
You must be signed in to change notification settings - Fork 4.2k
91 lines (90 loc) · 2.86 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: linux-x64-gpu-clang
on:
push:
branches: [master]
paths:
- '.github/workflows/linux-x64-gpu-clang.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
- 'tests/**'
- 'tools/**'
- '!tools/pnnx/**'
- 'examples/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/linux-x64-gpu-clang.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
- 'tests/**'
- 'tools/**'
- '!tools/pnnx/**'
- 'examples/**'
concurrency:
group: linux-x64-gpu-clang-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
linux-clang-gpu:
runs-on: [self-hosted, linux, cvm]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: cache-swiftshader
id: cache-swiftshader
uses: actions/cache@v4
with:
path: swiftshader-install
key: swiftshader-linux-install-20240622
- name: checkout-swiftshader
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: google/swiftshader
path: swiftshader
ref: de870ac7518fe2b6bb651ecc22fc36647cf7b986
- name: checkout-swiftshader-submodules
if: steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
cd swiftshader
git -c submodule."third_party/git-hooks".update=none 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 ..
cmake --build . -j 4
mkdir $GITHUB_WORKSPACE/swiftshader-install
cp Linux/* $GITHUB_WORKSPACE/swiftshader-install
- name: build
env:
CC: clang
CXX: clang++
run: |
mkdir build && cd build
cmake -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 4
- name: test
run: |
printf "[Processor]\nThreadCount=1\n" > build/tests/SwiftShader.ini
export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json"
cd build && ctest --output-on-failure -j 4
- name: build-shared
env:
CC: clang
CXX: clang++
run: |
mkdir build-shared && cd build-shared
cmake -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 4