Skip to content

Commit 3a37ab3

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

37 files changed

+178
-512
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ jobs:
144144
-DUR_DEVELOPER_MODE=ON
145145
-DUR_BUILD_TESTS=ON
146146
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
147-
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
148147
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
149148
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
150149
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
@@ -172,7 +171,8 @@ jobs:
172171
- name: Test adapters
173172
env:
174173
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
175-
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600 -VV
174+
LIT_OPTS: "--timeout 120"
175+
run: cmake --build build -j $(nproc) -- check-unified-runtime-conformance
176176

177177
- name: Get information about platform
178178
if: ${{ always() }}

unified-runtime/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 12 additions & 5 deletions
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +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_BACKEND
422+
.. envvar:: ONEAPI_DEVICE_SELECTOR
424423

425-
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.
426426

427427
.. envvar:: UR_CTS_ALSO_RUN_KNOWN_FAILURES
428428

unified-runtime/scripts/ctest_parser.py

Lines changed: 0 additions & 175 deletions
This file was deleted.

unified-runtime/test/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
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)