Skip to content

Commit e185000

Browse files
committed
[UR] Partially reapply "Move conformance tests over to lit" (#18382)
This reverts commit 44ed9b7, but excludes the problematic changes to jobs.
1 parent 44ed9b7 commit e185000

38 files changed

+176
-527
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ jobs:
156156
-DUR_DEVELOPER_MODE=ON
157157
-DUR_BUILD_TESTS=ON
158158
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
159-
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
160159
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
161160
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
162161
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
@@ -184,7 +183,8 @@ jobs:
184183
- name: Test adapters
185184
env:
186185
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
187-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600 -VV
186+
LIT_OPTS: " --timeout 120"
187+
run: cmake --build build -j $(nproc) -- check-unified-runtime-conformance
188188

189189
- name: Get information about platform
190190
if: ${{ always() }}

unified-runtime/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ set(UR_SYCL_LIBRARY_DIR "" CACHE PATH
6565
set(UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING
6666
"List of sycl targets to build CTS device binaries for")
6767
set(UR_CONFORMANCE_AMD_ARCH "" CACHE STRING "AMD device target ID to build CTS binaries for")
68-
option(UR_CONFORMANCE_ENABLE_MATCH_FILES "Enable CTS match files" ON)
69-
option(UR_CONFORMANCE_TEST_LOADER "Also test the loader in the conformance tests" OFF)
68+
set(UR_CONFORMANCE_SELECTOR "" CACHE STRING "If nonempty, the device selector for conformance tests")
7069
option(UR_USE_DEBUG_POSTFIX "Enable debug postfix 'd' for libraries" OFF)
7170
set(UR_ADAPTER_LEVEL_ZERO_SOURCE_DIR "" CACHE PATH
7271
"Path to external 'level_zero' adapter source dir")

unified-runtime/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ List of options provided by CMake:
128128
| UR_ENABLE_SANITIZER | Enable device sanitizer layer | ON/OFF | ON |
129129
| UR_CONFORMANCE_TARGET_TRIPLES | SYCL triples to build CTS device binaries for | Comma-separated list | spir64 |
130130
| UR_CONFORMANCE_AMD_ARCH | AMD device target ID to build CTS binaries for | string | `""` |
131-
| UR_CONFORMANCE_ENABLE_MATCH_FILES | Enable CTS match files | ON/OFF | ON |
132-
| UR_CONFORMANCE_TEST_LOADER | Additionally build and run "loader" tests for the CTS | ON/OFF | OFF |
131+
| UR_CONFORMANCE_SELECTOR | `ONEAPI_DEVICE_SELECTOR` for conformance testing | string | All enabled adapters |
133132
| UR_BUILD_ADAPTER_L0 | Build the Level-Zero adapter | ON/OFF | OFF |
134133
| UR_BUILD_ADAPTER_OPENCL | Build the OpenCL adapter | ON/OFF | OFF |
135134
| UR_BUILD_ADAPTER_CUDA | Build the CUDA adapter | ON/OFF | OFF |

unified-runtime/scripts/core/CONTRIB.rst

+12-5
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,21 @@ Conformance tests *must* not make assumptions about the adapter under test.
272272
Tests fixtures or cases *must* query for support of optional features and skip
273273
testing if unsupported by the adapter.
274274

275-
All tests in the Unified Runtime project are configured to use CTest to run.
276-
All conformance tests have the ``conformance`` label attached to them which
277-
allows them to be run independently. To run all the conformance tests, execute
278-
the following command from the build directory.
275+
Conformance tests are ran as part of the main ``test`` target, but can also be
276+
executed using the `check-unified-runtime-conformance` target as follows:
279277

280278
.. code-block:: console
281279
282-
ctest -L "conformance"
280+
cmake --build build --target check-unified-runtime-conformance
281+
282+
A specific device/adapter can be specified by using ``ONEAPI_DEVICE_SELECTOR``
283+
in the same way as in the `DPC++ compiler
284+
<https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md#oneapi_device_selector>`_.
285+
286+
A number of tests are skipped on certain adapters due to being known failures.
287+
To force all tests to run, including known failures,
288+
``UR_CTS_ALSO_RUN_KNOWN_FAILURES`` may be set to ``1`` as an environment
289+
variable.
283290

284291
Experimental Features
285292
=====================

unified-runtime/scripts/core/INTRO.rst

+4-18
Original file line numberDiff line numberDiff line change
@@ -417,26 +417,12 @@ CTS Environment Variables
417417

418418
The following environment variables are used by the CTS runner and can be used to specify the platform that the test
419419
framework should run on. This can be used during development and testing to run CTS tests in case multiple platforms
420-
are available. If both filters are specified, then they both must match a platform for it to be selected. If there are
421-
no valid platforms, then the tests will fail. Command line arguments take priority over these variables.
420+
are available. Conformance tests will be skipped if there are no valid platforms.
422421

423-
.. envvar:: UR_CTS_ADAPTER_PLATFORM
422+
.. envvar:: ONEAPI_DEVICE_SELECTOR
424423

425-
A specifier list in the form of `[(backend):](platform name)[;[(backend)]:(platform name)]...`. If a backend
426-
specific specifier is present in the list and the test is running for that backend, the device with the given name
427-
is chosen. Otherwise, it must match the name of the specifier from the list with no backend. Backend names are case-
428-
insensitive, however platform names must match exactly.
429-
430-
For example, if the test device has multiple platforms and you want to run tests on the "ABC Corp" backend when
431-
testing OpenCL and "XYZ Org" when testing level zero, you'd use `OPENCL:ABC Corp;LEVEL_ZERO:XYZ Org`. This form is
432-
useful when running the `build` target with a build with multiple backends.
433-
434-
For testing only one platform, the backend can be omitted. For example, just `ABC Corp` is sufficient if the tests
435-
are only going to be testing OpenCL.
436-
437-
.. envvar:: UR_CTS_BACKEND
438-
439-
A (case insensitive) backend to force the test to use. For example, `opencl`, `level_zero`, `hip` and so on.
424+
If ``ONEAPI_DEVICE_SELECTOR`` is set in the environment, only devices
425+
matched by the selector will be tested.
440426

441427
.. envvar:: UR_CTS_ALSO_RUN_KNOWN_FAILURES
442428

unified-runtime/scripts/ctest_parser.py

-175
This file was deleted.

unified-runtime/test/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ configure_file(lit.site.cfg.py.in lit.site.cfg.py)
3131
add_custom_target(deps_check-unified-runtime)
3232
if(UR_STANDALONE_BUILD)
3333
add_custom_target(check-unified-runtime
34-
COMMAND "${URLIT_LIT_BINARY}" "${CMAKE_CURRENT_BINARY_DIR}" -v
34+
COMMAND "${URLIT_LIT_BINARY}" "${CMAKE_CURRENT_BINARY_DIR}" -sv
3535
DEPENDS deps_check-unified-runtime
36+
USES_TERMINAL
3637
)
3738
else()
3839
# Use the LLVM method to add the test suite - this also registers it under `check-all`
@@ -60,7 +61,8 @@ function(add_ur_lit_testsuite suite)
6061

6162
if(UR_STANDALONE_BUILD)
6263
add_custom_target(${TARGET}
63-
COMMAND "${URLIT_LIT_BINARY}" "${CMAKE_CURRENT_BINARY_DIR}" -v
64+
COMMAND "${URLIT_LIT_BINARY}" "${CMAKE_CURRENT_BINARY_DIR}" -sv
65+
USES_TERMINAL
6466
)
6567
else()
6668
add_lit_testsuite(${TARGET} "Running Unified Runtime ${suite} tests"

0 commit comments

Comments
 (0)