Skip to content

[SYCL][E2E] Use configure_lit_site_cfg in in-tree builds #8854

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

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions sycl/test-e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ set(SYCL_E2E_TESTS_LIT_FLAGS "-sv" CACHE STRING "Flags used when running lit")

find_package(Python3 REQUIRED COMPONENTS Interpreter)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg")
if(SYCL_TEST_E2E_STANDALONE)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py")
else()
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)
endif() # Standalone.

if(NOT SYCL_TEST_E2E_STANDALONE)
list(APPEND SYCL_E2E_TEST_DEPS
Expand Down
17 changes: 15 additions & 2 deletions sycl/test-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ cmake -G Ninja ...
ninja check-sycl-e2e
```

In addition to this standalone configuration one can enable `check-sycl-e2e`
target for the sycl-toolchain workspace/build by specifying
In addition to this, in an in-tree configuration one can enable
`check-sycl-e2e` target for the sycl-toolchain workspace/build by specifying
`SYCL_TEST_E2E_TARGETS` as part of its cmake configuration. For example, like
this:

Expand All @@ -67,6 +67,19 @@ CC=<> CXX=<> python llvm/buildbot/configure.py -o build ... \
--cmake-opt=-DSYCL_E2E_TESTS_LIT_FLAGS="--param;dump_ir=True"``
```

In an in-tree build, individual tests or groups of tests can be conveniently
run directly from their source paths, using the configured `llvm-lit` script:

```
# Implicitly uses cmake parameters SYCL_BE and SYCL_TARGET_DEVICES, detailed
# below
Comment on lines +74 to +75
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it requires specifying them manually, in addition to SYCL_TEST_E2E_TARGETS above. Maybe worth adding a note somewhere here?

build/bin/llvm-lit -sv sycl/test-e2e/Basic/aspects.cpp

# Explicitly sets SYCL backend and target device(s), overriding SYCL_BE and
# SYCL_TARGET_DEVICES
build/bin/llvm-lit -sv --param sycl_be=level_zero --param target_devices=cpu,gpu sycl/test-e2e/Basic/aspects.cpp
```

# Cmake parameters

These parameters can be used to configure tests:
Expand Down