Skip to content

[SYCL][E2E] Fix -Werror failures in implicitly SPIR only DeviceLib tests #18995

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

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

Maetveis
Copy link
Contributor

The -fsycl-device-lib-jit-link only has an effect in SPIR compilation so these tests would fail with -Werror for non SPIR targets.

This basically the same as #18985, but also apply it to tests that have UNSUPPORTED: target-amd || target-nvidia. These tests could be enabled for future non-SPIR targets; we should not be assuming that !target-amd && !target-nvidia implies SPIR.

The `-fsycl-device-lib-jit-link` only has an effect in SPIR compilation
so these tests would fail with `-Werror` for non SPIR targets.

This basically the same as intel#18985, but also apply it to tests that have
`UNSUPPORTED: target-amd || target-nvidia`. These tests could be enabled
for future non-SPIR targets we should not be assuming that
`!target-amd && !target-nvidia` implies SPIR.
@Maetveis Maetveis requested a review from a team as a code owner June 16, 2025 14:51
@Maetveis Maetveis requested a review from steffenlarsen June 16, 2025 14:51
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t1.out
// RUN: %{run} %t1.out

// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
Copy link
Contributor

Choose a reason for hiding this comment

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

@aelovikov-intel, is there a cleaner way to handle the problem with %if?
If I get it right, we are supposed to add -fsycl-device-lib-jit-link only when we compile for spir target(s). I can't find similar examples in the existing tests. Do you know if there is a condition we can use e.g. %if spir %{-fsycl-device-lib-jit-link}?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure. We have something similar in

# TODO: Maybe that should be link-only option, so that we wouldn't
# need to suppress the warning below for compile-only commands.
sycl_target_opts += " -fsycl-use-spirv-backend-for-spirv-gen -Wno-unused-command-line-argument"
substitutions.append(("%{sycl_target_opts}", sycl_target_opts))

And based on some lines above that there might be %if target-spir. If it doesn't work, then

conditions = {x: True for x in parsed_dev_name.split(":")}
for cond_features in [
"linux",
"windows",
"preview-breaking-changes-supported",
]:
if cond_features in test.config.available_features:
conditions[cond_features] = True
tmp_script = lit.TestRunner.applySubstitutions(
tmp_script,
[],
conditions,
recursion_limit=test.config.recursiveExpansionLimit,
)
would be the place to debug, I think.

@bader
Copy link
Contributor

bader commented Jun 16, 2025

This basically the same as #18985, but also apply it to tests that have UNSUPPORTED: target-amd || target-nvidia. These tests could be enabled for future non-SPIR targets; we should not be assuming that !target-amd && !target-nvidia implies SPIR.

We have REQUIRES: target-spir. Can we use it instead?

@aelovikov-intel
Copy link
Contributor

We have REQUIRES: target-spir. Can we use it instead?

Are you asking me or @Maetveis ?

@bader
Copy link
Contributor

bader commented Jun 16, 2025

We have REQUIRES: target-spir. Can we use it instead?

Are you asking me or @Maetveis ?

The author of the text from the PR description quoted in my comment.

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.

4 participants