-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (161 loc) · 7.76 KB
/
build_linux.yml
File metadata and controls
177 lines (161 loc) · 7.76 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
---
name: Linux / CPU x86-64 tests
permissions:
contents: read
on:
push:
branches:
- 'main'
- 'release*'
workflow_dispatch:
pull_request:
paths-ignore:
- 'doc/**'
- 'CHANGES'
- 'COPYING'
- 'CREDITS'
- 'LICENSE'
- 'README.*'
- 'tools/docker/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
env:
CCACHE_BASEDIR: "${{ github.workspace }}"
CCACHE_DIR: "${{ github.workspace }}/../../../../ccache_storage"
EXAMPLES_DIR: "${{ github.workspace }}/../../../../examples"
jobs:
main_test_matrix:
name: LLVM ${{ matrix.llvm }} - ${{ matrix.config }}
runs-on: [self-hosted, linux, x64, "${{ matrix.config }}" ]
# CPU runners have action runner directly in the home directory
env:
CCACHE_BASEDIR: "${{ github.workspace }}"
CCACHE_DIR: "${{ github.workspace }}/../../../ccache_storage"
EXAMPLES_DIR: "${{ github.workspace }}/../../../examples"
TSAN_OPTIONS: "second_deadlock_stack=1"
strategy:
fail-fast: false
matrix:
llvm: [19, 20]
# cts_spirv = cts with SPIR-V
# tier1 = includes CTS without SPIR-V
# chipstar 1.1 only supports LLVM up to 17
# chipstar 1.2 only supports LLVM up to 19
# asan, tsan, ubsan = sanitizers
config: [cts_spirv, tier1, asan, tsan, ubsan]
include:
- llvm: 19
config: chipstar
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Load Env vars
id: load-env
run: |
cat ${{ github.workspace }}/.github/variables.txt >> $GITHUB_ENV
- name: CMake
id: cmake
run: |
runCMake() {
BUILD_FLAGS="-O1 -ggdb -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable"
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=RelWithDebInfo "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$BUILD_FLAGS" \
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$BUILD_FLAGS" \
-DWITH_LLVM_CONFIG=/usr/bin/llvm-config-${{ matrix.llvm }} -DLLVM_SPIRV=/usr/bin/llvm-spirv-${{ matrix.llvm }} \
"$@" -B ${{ github.workspace }}/build ${{ github.workspace }}
}
rm -rf ${{ github.workspace }}/build
mkdir ${{ github.workspace }}/build
if [ "${{ matrix.config }}" == "cts_spirv" ]; then
mkdir -p ${EXAMPLES_DIR}/build_cts_spirv
mkdir -p ${EXAMPLES_DIR}/source
runCMake -DENABLE_TESTSUITES=conformance -DENABLE_CONFORMANCE=ON -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_cts_spirv
elif [ "${{ matrix.config }}" == "tier1" ]; then
mkdir -p ${EXAMPLES_DIR}/build_tier1
runCMake "-DENABLE_TESTSUITES=AMDSDK3.0;piglit;conformance;PyOpenCL;IntelSVM;UnitCL" -DENABLE_CONFORMANCE=ON -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_tier1
elif [ "${{ matrix.config }}" == "chipstar" ]; then
mkdir -p ${EXAMPLES_DIR}/build_chipstar_${{ matrix.llvm }}
mkdir -p ${EXAMPLES_DIR}/source
runCMake -DENABLE_TESTSUITES=chipStar -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_chipstar_${{ matrix.llvm }}
elif [ "${{ matrix.config }}" == "asan" ]; then
runCMake -DENABLE_ASAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DDEVELOPER_MODE=ON
elif [ "${{ matrix.config }}" == "tsan" ]; then
runCMake -DENABLE_TSAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DDEVELOPER_MODE=ON -DENABLE_PRINTF_IMMEDIATE_FLUSH=OFF
elif [ "${{ matrix.config }}" == "ubsan" ]; then
runCMake -DENABLE_UBSAN=1 -DENABLE_LATEST_CXX_STD=ON -DENABLE_ICD=0 -DDEVELOPER_MODE=ON -DENABLE_LOADABLE_DRIVERS=0
else
echo "Unknown configuration" && exit 1
fi
- name: Build PoCL
id: build_pocl
timeout-minutes: 30
run: |
cd ${{ github.workspace }}/build && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh)
- name: Build CTS Examples
id: build_cts_examples
# occasionally git timeouts on git clone of the examples
timeout-minutes: 60
if: ${{ matrix.config == 'cts_spirv' || matrix.config == 'tier1' }}
run: |
cd ${{ github.workspace }}/build/examples/conformance && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) conformance
- name: Build Tier1 Examples
id: build_tier1_examples
# occasionally git timeouts on git clone of the examples
timeout-minutes: 90
if: ${{ matrix.config == 'tier1' }}
run: |
cd ${{ github.workspace }}/build/examples/AMDSDK3.0 && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) AMDSDK3.0
cd ${{ github.workspace }}/build/examples/piglit && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) piglit
# currently broken
#cd ${{ github.workspace }}/build/examples/PyOpenCL && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) PyOpenCL
cd ${{ github.workspace }}/build/examples/IntelSVM && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) IntelSVM
cd ${{ github.workspace }}/build/examples/UnitCL && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) UnitCL
- name: Build chipStar Examples
id: build_chipstar_examples
# occasionally git timeouts on git clone of the examples
timeout-minutes: 90
if: ${{ matrix.config == 'chipstar' }}
run: |
cd ${{ github.workspace }}/build/examples/chipStar && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) chipStar
- name: Get CMake version
id: cmake_version
run: echo "version=$(cmake --version | head -n 1)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache CTest timings
id: cache_ctest
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: ${{ github.workspace }}/build/Testing/Temporary/CTestCostData.txt
key: ctest-cache-${{ steps.cmake_version.outputs.version }}-${{ runner.name }}-${{ matrix.config }}-${{ github.run_id }}
restore-keys: ctest-cache-${{ steps.cmake_version.outputs.version }}-${{ runner.name }}-${{ matrix.config }}
- name: Run Tests
env:
POCL_CACHE_DIR: "${{ runner.temp }}/GH_POCL_CACHE"
CL_PLATFORM_NAME: "Portable"
CL_DEVICE_TYPE: "cpu"
id: ctest
timeout-minutes: 120
run: |
runCTest() {
cd ${{ github.workspace }}/build && ctest -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) $CTEST_FLAGS "$@"
}
rm -rf ${{ env.POCL_CACHE_DIR }}
# hardcoded path in test_compiler / execute_after_included_header_link
rm -rf /tmp/foo
mkdir ${{ env.POCL_CACHE_DIR }}
if [ "${{ matrix.config }}" == "cts_spirv" ]; then
runCTest -L conformance_suite_micro_spirv
elif [ "${{ matrix.config }}" == "tier1" ]; then
runCTest -L "amdsdk_30|piglit|PyOpenCL|conformance_suite_micro_main|IntelSVM|UnitCL"
elif [ "${{ matrix.config }}" == "chipstar" ]; then
runCTest -L chipStar
elif [ "${{ matrix.config }}" == "asan" ]; then
runCTest -L "runtime|asan"
elif [ "${{ matrix.config }}" == "tsan" ]; then
runCTest -L "cpu|tsan"
elif [ "${{ matrix.config }}" == "ubsan" ]; then
runCTest -L "cpu|ubsan"
else
echo "Unknown configuration" && exit 1
fi