Skip to content

Commit fd9b9ef

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: oneapi-src#2081
1 parent 1487f4b commit fd9b9ef

File tree

6 files changed

+56
-14
lines changed

6 files changed

+56
-14
lines changed

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

Lines changed: 21 additions & 5 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.
@@ -82,8 +95,9 @@ jobs:
8295
-DUR_ENABLE_TRACING=ON
8396
-DUR_DEVELOPER_MODE=ON
8497
-DUR_BUILD_TESTS=ON
85-
-DUR_CONFORMANCE_TEST_LOADER=OFF
8698
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
99+
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
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++
@@ -103,10 +117,12 @@ jobs:
103117
- name: Test adapter specific
104118
working-directory: ${{github.workspace}}/build
105119
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
120+
# Don't run adapter specific tests when building multiple adapters
121+
if: ${{ matrix.adapter.other_name == '' }}
106122

107123
- name: Test adapters
108124
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
125+
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
110126

111127
- name: Get information about platform
112128
if: ${{ always() }}

.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
191+
combined-opencl-native-cpu:
192+
name: OpenCL + Native CPU
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: "Intel(R) OpenCL"
199+
200+
combined-level-zero-native-cpu:
201+
name: Level Zero + Native CPU
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: 4 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,6 @@ 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+
# These crash when ran through the loader
35+
{{OPT}}urEventRetainTest.InvalidNullHandle/*
36+
{{OPT}}urEventReleaseTest.InvalidNullHandle/*
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
2+
# These crash when ran through the loader
3+
{{OPT}}urEventSetCallbackTest.ValidateParameters/*

test/conformance/usm/usm_adapter_opencl.match

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/Intel_R__OpenCL___{{.*}}__
4545
urUSMHostAllocAlignmentTest.SuccessAlignedAllocations/Intel_R__OpenCL___{{.*}}___UsePoolEnabled_64_2048
4646
urUSMPoolCreateTest.Success/Intel_R__OpenCL___{{.*}}
4747
urUSMPoolCreateTest.SuccessWithFlag/Intel_R__OpenCL___{{.*}}
48-
urUSMPoolCreateTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}
49-
urUSMPoolCreateTest.InvalidNullPointerPoolDesc/Intel_R__OpenCL___{{.*}}
50-
urUSMPoolCreateTest.InvalidNullPointerPool/Intel_R__OpenCL___{{.*}}
51-
urUSMPoolCreateTest.InvalidEnumerationFlags/Intel_R__OpenCL___{{.*}}
48+
# These tests pass when ran through the loader
49+
{{OPT}}urUSMPoolCreateTest.InvalidNullHandleContext/Intel_R__OpenCL___{{.*}}
50+
{{OPT}}urUSMPoolCreateTest.InvalidNullPointerPoolDesc/Intel_R__OpenCL___{{.*}}
51+
{{OPT}}urUSMPoolCreateTest.InvalidNullPointerPool/Intel_R__OpenCL___{{.*}}
52+
{{OPT}}urUSMPoolCreateTest.InvalidEnumerationFlags/Intel_R__OpenCL___{{.*}}
5253
urUSMPoolGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_USM_POOL_INFO_CONTEXT
5354
urUSMPoolGetInfoTestWithInfoParam.Success/Intel_R__OpenCL___{{.*}}___UR_USM_POOL_INFO_REFERENCE_COUNT
5455
urUSMPoolGetInfoTest.InvalidNullHandlePool/Intel_R__OpenCL___{{.*}}

0 commit comments

Comments
 (0)