File: build_linux.yml

package info (click to toggle)
pocl 7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 29,768 kB
  • sloc: lisp: 151,669; ansic: 135,425; cpp: 65,801; python: 1,846; sh: 1,084; ruby: 255; pascal: 231; tcl: 180; makefile: 174; asm: 81; java: 72; xml: 49
file content (200 lines) | stat: -rw-r--r-- 9,649 bytes parent folder | download
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
---
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

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: [20, 21]
        # 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
        # openvx = OpenVX-CTS
        config: [cts_spirv, tier1, asan, tsan, ubsan]
        include:
          - llvm: 19
            config: chipstar
          - llvm: 20
            config: openvx

    steps:
      - name: Checkout
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

      - name: Load Env vars
        id: load-env
        run: |
          cat ${{ github.workspace }}/.github/variables.txt >> $GITHUB_ENV

      - name: CMake
        id: cmake
        run: |
          export BUILD_FLAGS="-O1 -ggdb -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable"

          runCMake() {
            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_llvm_${{ matrix.llvm }}
            # disable UnitCL for LLVM 21, it's incompatible with it
            if [ "${{ matrix.llvm }}" == "21"  ]; then
              runCMake "-DENABLE_TESTSUITES=AMDSDK3.0;piglit;conformance;PyOpenCL;IntelSVM" -DENABLE_CONFORMANCE=ON -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_tier1_llvm_${{ matrix.llvm }}
            else
              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_llvm_${{ matrix.llvm }}
            fi
          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 }}" == "openvx" ]; then
            mkdir -p ${EXAMPLES_DIR}/build_openvx
            mkdir -p ${EXAMPLES_DIR}/source
            runCMake -DENABLE_TESTSUITES=OpenVX_CTS -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_openvx
          elif [ "${{ matrix.config }}" == "asan" ]; then
            export BUILD_FLAGS="-O1 -ggdb -fno-omit-frame-pointer -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable"
            runCMake -DENABLE_ASAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DDEVELOPER_MODE=ON
          elif [ "${{ matrix.config }}" == "tsan" ]; then
            export BUILD_FLAGS="-O1 -ggdb -fno-omit-frame-pointer -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable"
            runCMake -DENABLE_TSAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DDEVELOPER_MODE=ON -DENABLE_PRINTF_IMMEDIATE_FLUSH=OFF
          elif [ "${{ matrix.config }}" == "ubsan" ]; then
            export BUILD_FLAGS="-O1 -ggdb -fno-omit-frame-pointer -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable"
            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
        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
          if [ "${{ matrix.llvm }}" != "21"  ]; then
            cd ${{ github.workspace }}/build/examples/UnitCL && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) UnitCL
          fi

      - name: Build chipStar
        id: build_chipstar
        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: Build OpenVX-CTS
        id: build_openvx_cts
        timeout-minutes: 90
        if: ${{ matrix.config == 'openvx' }}
        run: |
          cd ${{ github.workspace }}/build/examples/OpenVX_CTS && make -j$(${{ github.workspace }}/.github/scripts/get_cpus.sh) OpenVX_CTS

      - 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 && ${{ github.workspace }}/tools/scripts/run_cpu_tests -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 }}" == "openvx" ]; then
            runCTest -L openvx
          elif [ "${{ matrix.config }}" == "asan" ]; then
          # test_large_buf consumes too much memory for the smaller bots
            runCTest -R runtime -E test_large_buf
          elif [ "${{ matrix.config }}" == "tsan" ]; then
          # thread sanitizer does not support C11 <threads.h>
          # implementation of threading, only pthreads.
          # issue: https://github.com/google/sanitizers/issues/1603
            runCTest -E 'test_large_buf|clSetEventCallback'
          elif [ "${{ matrix.config }}" == "ubsan" ]; then
            runCTest -E test_large_buf
          else
            echo "Unknown configuration" && exit 1
          fi