Files
TheRock/compiler/amd-llvm/libsycl/test/README.md
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

83 lines
2.7 KiB
Markdown

## Getting Started
This directory contains `libsycl` tests distributed in subdirectories based on
testing scope. `libsycl` uses LIT to configure and run its tests.
Please see the [Lit Command Guide](https://llvm.org/docs/CommandGuide/lit.html)
for more information about LIT.
## Prerequisites
* Target runtime(s) to execute tests on devices.
TODO: add link to liboffload instruction once they add it.
* Compiler & libsycl. Can be built following these
[instructions](/libsycl/docs/index.rst).
## Run the tests
`libsycl` is integrated via `LLVM_ENABLE_RUNTIMES` and is not visible as a top
level target. The same is applicable to tests. To run `check-sycl` tests you need
to prepend `<build>/runtimes/runtimes-bins/` to the paths of all tests.
For example, to run all the `libsycl` tests you can do:
```bash
<build>/bin/llvm-lit <build>/runtimes/runtimes-bins/libsycl/test
```
To run an individual test, use the path to it instead.
If you are using `ninja` as your build system, you can run all the tests in the
`libsycl` testsuite as:
```bash
ninja -C <build>/runtimes/runtimes-bins check-sycl
```
## CMake parameters
These parameters can be used to configure tests:
`LIBSYCL_CXX_COMPILER` - path to compiler to use it for building tests.
`LIBSYCL_TEST_COMPILER_OPTIONS` - flags to be passed to `LIBSYCL_CXX_COMPILER` when
building libsycl tests.
`LLVM_LIT` - path to llvm-lit tool.
## Creating or modifying tests
### LIT feature checks
Following features can be passed to LIT via `REQUIRES`, `UNSUPPORTED`, etc.
filters to limit test execution to the specific environment.
#### Auto-detected features
The following features are automatically detected by `llvm-lit` by scanning the
environment:
* `any-device` - presence of at least 1 supported device;
* `any-device-is-gpu` - device type to be available;
* `any-device-is-level_zero` - backend to be available;
Note: the `sycl-ls` tool doesn't have an assigned feature since it is essential for
test configuration and is always available.
### llvm-lit parameters
The following options can be passed to the `llvm-lit` tool with `--param`
option to configure test execution:
* `libsycl_compiler` - full path to compiler to use.
* `extra_environment` - comma-separated list of variables with values to be
added to the test environment. Can be also set by the `LIT_EXTRA_ENVIRONMENT`
variable in CMake.
* `extra_system_environment` - comma-separated list of variables to be
propagated from the host environment to the test environment. Can be also set
by `LIT_EXTRA_SYSTEM_ENVIRONMENT` variable in CMake.
Example:
```bash
<build>/bin/llvm-lit --param libsycl_compiler=path/to/clang++ \
<build>/runtimes/runtimes-bins/libsycl/test
```