Skip to content

Commit 0b96866

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 are new "combined" jobs with OpenCL/Level Zero + Native CPU. Closes: #2081
1 parent f01741a commit 0b96866

File tree

5 files changed

+49
-9
lines changed

5 files changed

+49
-9
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ 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:
18+
description: "Platform string, `UR_CTS_ADAPTER_PLATFORM` will be set to this."
1419
required: false
1520
type: string
1621
default: ""
@@ -39,9 +44,13 @@ jobs:
3944
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
4045
strategy:
4146
matrix:
42-
adapter: [
43-
{name: "${{inputs.adapter_name}}", platform: "${{inputs.platform}}", static_Loader: "${{inputs.static_loader}}", static_adapter: "${{inputs.static_loader}}"},
44-
]
47+
adapter: [{
48+
name: "${{inputs.adapter_name}}",
49+
other_name: "${{inputs.other_adapter_name}}",
50+
platform: "${{inputs.platform}}",
51+
static_Loader: "${{inputs.static_loader}}",
52+
static_adapter: "${{inputs.static_loader}}"
53+
}]
4554
build_type: [Debug, Release]
4655
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
4756
# TODO: The latest L0 loader segfaults when built with clang.
@@ -82,8 +91,9 @@ jobs:
8291
-DUR_ENABLE_TRACING=ON
8392
-DUR_DEVELOPER_MODE=ON
8493
-DUR_BUILD_TESTS=ON
85-
-DUR_CONFORMANCE_TEST_LOADER=OFF
8694
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
95+
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
96+
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
8797
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
8898
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
8999
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
@@ -103,6 +113,8 @@ jobs:
103113
- name: Test adapter specific
104114
working-directory: ${{github.workspace}}/build
105115
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
116+
# Don't run adapter specific tests when building multiple adapters
117+
if: ${{ matrix.adapter.other_name == '' }}
106118

107119
- name: Test adapters
108120
working-directory: ${{github.workspace}}/build

.github/workflows/cmake.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,24 @@ jobs:
187187
adapter_name: NATIVE_CPU
188188
runner_name: NATIVE_CPU
189189

190+
# Native CPU jobs are here to force the loader to be used (UR will not use the loader if there is only one target)
191+
combined-opencl-native-cpu:
192+
name: OpenCL + Native CPU (Loader)
193+
uses: ./.github/workflows/build-hw-reusable.yml
194+
with:
195+
adapter_name: OPENCL
196+
other_adapter_name: NATIVE_CPU
197+
runner_name: OPENCL
198+
platform: "OPENCL:Intel(R) OpenCL"
199+
200+
combined-level-zero-native-cpu:
201+
name: Level Zero + Native CPU (Loader)
202+
uses: ./.github/workflows/build-hw-reusable.yml
203+
with:
204+
adapter_name: L0
205+
other_adapter_name: NATIVE_CPU
206+
runner_name: L0
207+
190208
e2e-level-zero:
191209
name: E2E L0
192210
permissions:
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{NONDETERMINISTIC}}
2-
urAdapterGetLastErrorTest.Success
3-
urAdapterGetLastErrorTest.InvalidHandle
4-
urAdapterGetLastErrorTest.InvalidMessagePtr
5-
urAdapterGetLastErrorTest.InvalidErrorPtr
2+
# These pass when the adapter is launched by the loader
3+
{{OPT}}urAdapterGetLastErrorTest.Success
4+
{{OPT}}urAdapterGetLastErrorTest.InvalidHandle
5+
{{OPT}}urAdapterGetLastErrorTest.InvalidMessagePtr
6+
{{OPT}}urAdapterGetLastErrorTest.InvalidErrorPtr

test/conformance/event/event_adapter_native_cpu.match

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{NONDETERMINISTIC}}
1+
# Note: This file is only for use with cts_exe.py
22
urEventGetInfoTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}__UR_EVENT_INFO_COMMAND_QUEUE
33
urEventGetInfoTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}__UR_EVENT_INFO_CONTEXT
44
urEventGetInfoTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}__UR_EVENT_INFO_COMMAND_TYPE
@@ -31,3 +31,9 @@ urEventSetCallbackTest.AllStates/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}
3131
urEventSetCallbackTest.EventAlreadyCompleted/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}
3232
urEventSetCallbackNegativeTest.InvalidNullPointerCallback/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}
3333
urEventSetCallbackNegativeTest.InvalidEnumeration/SYCL_NATIVE_CPU___SYCL_Native_CPU__{{.*}}
34+
35+
# These crash when ran through the loader
36+
{{OPT}}urEventRetainTest.InvalidNullHandle/*
37+
{{OPT}}urEventReleaseTest.InvalidNullHandle/*
38+
{{OPT}}urEventGetNativeHandleTest.InvalidNullHandleEvent/*
39+
{{OPT}}urEventSetCallbackNegativeTest.InvalidNullHandleEvent/*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Note: This file is only for use with cts_exe.py, not the legacy match checker
2+
# These crash when ran through the loader
3+
{{OPT}}urEventSetCallbackTest.ValidateParameters/*

0 commit comments

Comments
 (0)