Skip to content

Conversation

Maetveis
Copy link
Contributor

@Maetveis Maetveis commented Sep 10, 2025

Before #9075 the value of CMAKE_CXX_FLAGS was passed to SYCL E2E compilations. In #9075 the variable was explicitly unset in non-standalone (in-tree) builds of the tests. Unsetting a normal variable however exposes the cmake cache variable of the same name.

I believe this was not the intent, rather the intent was to not pass any CMAKE_CXX_FLAGS to the E2E tests in non-standalone builds. It is weird to pass the user's CMAKE_CXX_FLAGS to the E2E tests, as these flags are for the SYCL toolchain, not tests.

Passing CMAKE_CXX_FLAGS to the E2E tests can cause problems, for example a test might wish to override options such as setting -ffp-model=fast, but this fails with a warning/error if CMAKE_CXX_FLAGS contains -ffp-model=precise: error: overriding '-ffp-model=precise' option with '-ffp-model=fast' [-Werror,-Woverriding-option].

While the error could be worked around in the test by appending -Wno-overriding-option to the test flags, I don't believe this is the right solution.

It is possible that the user is running on a system where some flags have to be passed to clang++ to make it produce working executables. For this reason, allow setting SYCL_E2E_CLANG_CXX_FLAGS by the user if needed in in-tree builds, but do not pass CMAKE_CXX_FLAGS by default.

Contains a drive-by fix to make sure -Werror is passed to clang++ even when the c++ flags are overriden by the lit parameter --param cxx_flags=... (it can still be disabled using -Wno-error explicitly).

Before intel#9075 the value of CMAKE_CXX_FLAGS was passed to SYCL E2E
compilations. In intel#9075 the variable was explicitly unset in
non-standalone (in-tree) builds of the tests. Unsetting a normal
variable however exposes the cmake cache variable of the same name.

I believe this was not the intent, rather the intent was to not pass
any CMAKE_CXX_FLAGS to the E2E tests in non-standalone builds. It is weird
to pass the user's CMAKE_CXX_FLAGS to the E2E tests, as these flags
are for the SYCL toolchain, not tests.

Passing `CMAKE_CXX_FLAGS` to the E2E tests can cause problems, for example
a test might wish to override options such as setting `-ffp-model=fast`, but this can
fails with a warning/error if `CMAKE_CXX_FLAGS` contains `-ffp-model=precise`:
`error: overriding '-ffp-model=precise' option with '-ffp-model=fast' [-Werror,-Woverriding-option]`.

While the error could be worked around in the test by appending `-Wno-overriding-option`
to the test flags, I don't believe this is the right solution.

It is possible that the user is running on a system where some flags
have to be passed to clang++ to make it produce working executables.
For this reason, allow setting `SYCL_E2E_CLANG_CXX_FLAGS` by the user
if needed in in-tree builds, but do not pass `CMAKE_CXX_FLAGS` by default.

Contains a drive-by fix to make sure `-Werror` is passed to clang++ even
when the c++ flags are overriden by the lit parameter `--param cxx_flags=...`
(it can still be disabled using `-Wno-error` explicitly).
@Maetveis
Copy link
Contributor Author

run_prebuilt_e2e_tests (Intel Battlemage Graphics, ["Linux", "bmg"]

********************
Failed Tests (21):
  SYCL :: Complex/sycl_complex_math_test.cpp
  SYCL :: Complex/sycl_complex_operator_test.cpp
  SYCL :: DeviceLib/imf/fp32_test.cpp
  SYCL :: DeviceLib/math_test_marray_vec.cpp
  SYCL :: DeviceLib/math_test_marray_vec_fp16.cpp
  SYCL :: Reduction/reduction_span_pack.cpp
  SYCL :: USM/copy.cpp
  SYCL :: USM/memops2d/copy2d_device_to_dhost.cpp
  SYCL :: USM/memops2d/copy2d_device_to_host.cpp
  SYCL :: USM/memops2d/copy2d_device_to_shared.cpp
  SYCL :: USM/memops2d/copy2d_dhost_to_device.cpp
  SYCL :: USM/memops2d/copy2d_host_to_device.cpp
  SYCL :: USM/memops2d/copy2d_host_to_shared.cpp
  SYCL :: USM/memops2d/copy2d_shared_to_device.cpp
  SYCL :: USM/memops2d/copy2d_shared_to_dhost.cpp
  SYCL :: USM/memops2d/copy2d_shared_to_host.cpp
  SYCL :: USM/memops2d/copy2d_shared_to_shared.cpp
  SYCL :: USM/memops2d/memcpy2d_device_to_device.cpp
  SYCL :: USM/memops2d/memcpy2d_device_to_host.cpp
  SYCL :: USM/memops2d/memcpy2d_shared_to_host.cpp
  SYCL :: USM/memops2d/memcpy2d_shared_to_shared.cpp

I believe the USM failures are unrelated, they are tracked by #19749

The other errors seem to be due to

level_zero backend failed with error: 20 (UR_RESULT_ERROR_DEVICE_LOST)

Which is possibly a driver problem? I'll update the branch and try again, but I don't expect these to be related to the changes here.

@Maetveis
Copy link
Contributor Author

@intel/llvm-gatekeepers this is ready to merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants