Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UR] Move non-conformance/adapter tests to lit #17580

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ur-build-hw.yml
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ jobs:
. .venv/bin/activate
echo "$PATH" >> $GITHUB_PATH
pip install -r third_party/requirements.txt
pip install -r third_party/requirements_testing.txt

- name: Download DPC++
run: |
6 changes: 4 additions & 2 deletions .github/workflows/ur-precommit.yml
Original file line number Diff line number Diff line change
@@ -89,11 +89,13 @@ jobs:

- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.0.0
with:
python-version: 3.9
python-version: "3.10"

- name: Install prerequisites
working-directory: ${{github.workspace}}/unified-runtime
run: python3 -m pip install -r third_party/requirements.txt
run: |
python3 -m pip install -r third_party/requirements.txt
python3 -m pip install -r third_party/requirements_testing.txt

- name: Install hwloc
run: brew install hwloc
9 changes: 6 additions & 3 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
@@ -23,9 +23,12 @@ option(SYCL_UR_USE_FETCH_CONTENT
set(SYCL_UR_SOURCE_DIR
"" CACHE PATH "Path to root of Unified Runtime repository")

# Here we override the defaults to disable building tests from unified-runtime
set(UR_BUILD_EXAMPLES OFF CACHE BOOL "Build example applications." FORCE)
set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests." FORCE)
option(SYCL_UR_BUILD_TESTS "Build tests for UR" OFF)
set(UR_BUILD_TESTS "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE)
# UR tests require the examples to be built
set(UR_BUILD_EXAMPLES "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE)

# Here we override the defaults to unified-runtime
set(UR_BUILD_XPTI_LIBS OFF)
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
set(UR_ENABLE_TRACING ON)
18 changes: 16 additions & 2 deletions unified-runtime/README.md
Original file line number Diff line number Diff line change
@@ -149,15 +149,29 @@ List of options provided by CMake:
| UR_HIP_HSA_INCLUDE_DIRS | Path of the ROCm HSA include directory | Directory path | `${UR_HIP_ROCM_DIR}/hsa/include;${UR_HIP_ROCM_DIR}/include` |
| UR_HIP_LIB_DIR | Path of the ROCm HIP library directory | Directory path | `${UR_HIP_ROCM_DIR}/lib` |

### Additional make targets
### Testing

To run tests, do the following:
Unified Runtime uses `lit` and `FileCheck` as part of its test suite. When built as
part of an LLVM build, the binaries provided by LLVM will be used. When built standalone,
both `lit` and `FileCheck` (or `filecheck`) must be visible on `$PATH`. The easiest way
to do this is to install the Python packages for `lit` and `filecheck`.

```bash
$ source .venv/bin/activate
$ pip install -r third_party/requirements_testing.txt
```

> Note: `filecheck` requires Python >= 3.10; if you get errors claiming that `filecheck` is not available, update your Python version or disable testing.

Once installed, tests can be executed using:

```bash
$ make
$ make test
```

### Additional make targets

To run automated code formatting, configure CMake with `UR_FORMAT_CPP_STYLE` option
and then run a custom `cppformat` target:

29 changes: 29 additions & 0 deletions unified-runtime/cmake/FindLit.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2025 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


# There are two modes to finding lit and filecheck
# If we are a standalone build, use the python packages
# If we are not a standalone build, use the one provided by LLVM
# Note that the python filecheck re-implementation isn't 100% compatible, but hopefully for simple tests it should be
# good enough

if(UR_STANDALONE_BUILD)
# Standalone build
find_program(URLIT_LIT_BINARY "lit")
if(NOT URLIT_LIT_BINARY)
message(FATAL_ERROR "No `lit` binary was found in path. Consider installing the python Package `lit`")
endif()

find_program(URLIT_FILECHECK_BINARY NAMES "filecheck" "FileCheck")
if(NOT URLIT_FILECHECK_BINARY)
message(FATAL_ERROR "No `filecheck` or `FileCheck` binary was found in path. Consider installing the python Package `filecheck`")
endif()
else()
# In source build

# This will be in the $PATH
set(URLIT_FILECHECK_BINARY "FileCheck")
endif()
77 changes: 0 additions & 77 deletions unified-runtime/cmake/match.cmake

This file was deleted.

Loading
Oops, something went wrong.