Skip to content

Commit 0193d8e

Browse files
committed
[CI] Add "loader" support to conformance testing
This expands our CI to test the loader; the dispatcher that is used when multiple adapters are availabe. The old "run on hardware" jobs should behave the same (they have the loader tests disabled), but there is a new `combined-opencl-level-zero` job that tests a build with both OpenCL and Level Zero available.
1 parent f8f1ccb commit 0193d8e

File tree

4 files changed

+594
-4
lines changed

4 files changed

+594
-4
lines changed

.github/workflows/build-hw-reusable.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ on:
77
adapter_name:
88
required: true
99
type: string
10+
other_adapter_name:
11+
required: false
12+
type: string
13+
default: ""
1014
runner_name:
1115
required: true
1216
type: string
1317
platform:
1418
required: false
1519
type: string
1620
default: ""
21+
other_platform:
22+
required: false
23+
type: string
24+
default: ""
1725
static_loader:
1826
required: false
1927
type: string
@@ -39,9 +47,14 @@ jobs:
3947
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
4048
strategy:
4149
matrix:
42-
adapter: [
43-
{name: "${{inputs.adapter_name}}", platform: "${{inputs.platform}}", static_Loader: "${{inputs.static_loader}}", static_adapter: "${{inputs.static_loader}}"},
44-
]
50+
adapter: [{
51+
name: "${{inputs.adapter_name}}",
52+
other_name: "${{inputs.other_adapter_name}}",
53+
platform: "${{inputs.platform}}",
54+
other_platform: "${{inputs.other_platform}}",
55+
static_Loader: "${{inputs.static_loader}}",
56+
static_adapter: "${{inputs.static_loader}}"
57+
}]
4558
build_type: [Debug, Release]
4659
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
4760
# TODO: The latest L0 loader segfaults when built with clang.
@@ -84,11 +97,13 @@ jobs:
8497
-DUR_BUILD_TESTS=ON
8598
-DUR_CONFORMANCE_TEST_LOADER=OFF
8699
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
100+
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
87101
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
88102
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
89103
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
90104
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
91105
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
106+
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
92107
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
93108
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
94109
@@ -103,10 +118,12 @@ jobs:
103118
- name: Test adapter specific
104119
working-directory: ${{github.workspace}}/build
105120
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
121+
# Don't run adapter specific tests when building multiple adapters
122+
if: ${{ matrix.adapter.other_name == '' }}
106123

107124
- name: Test adapters
108125
working-directory: ${{github.workspace}}/build
109-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
126+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.name}}:${{matrix.adapter.platform}};${{matrix.adapter.other_name}}:${{matrix.adapter.other_platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
110127

111128
- name: Get information about platform
112129
if: ${{ always() }}

.github/workflows/cmake.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ jobs:
177177
adapter_name: NATIVE_CPU
178178
runner_name: NATIVE_CPU
179179

180+
combined-opencl-level-zero:
181+
name: OpenCL + Level Zero
182+
uses: ./.github/workflows/build-hw-reusable.yml
183+
with:
184+
adapter_name: OPENCL
185+
other_adapter_name: L0
186+
runner_name: L0
187+
platform: "Intel(R) OpenCL"
188+
180189
e2e-level-zero:
181190
name: E2E L0
182191
permissions:

scripts/templates/ldrddi.cpp.mako

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ namespace ur_loader
4040
add_local = False
4141
%>${th.get_initial_null_set(obj)}
4242

43+
// For testing
44+
abort();
45+
4346
[[maybe_unused]] auto context = getContext();
4447
%if re.match(r"\w+AdapterGet$", th.make_func_name(n, tags, obj)):
4548

0 commit comments

Comments
 (0)