Skip to content

Commit 00811c1

Browse files
authored
[SYCL][E2E] Add selected targets to available features set (#16860)
This resolves two issues: - Currently in `build-only` XFAILs for target features don't trigger because the target feature is not in the available features set. - Being able to use the target feature instead of `any-target-is` for `%if` conditions in run lines allows us to only add the bit enclosed in the condition if that target is selected. So for example if a particular target is available, but it is marked as xfail/unsupported for a given test we dont add the bits enclosed in `%if target-`. On the other hand if this were enclosed with `%if any-target-is-`, we would add it, which is not always desirable.
1 parent 8461560 commit 00811c1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sycl/test-e2e/Regression/multiple-targets.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
// The test is repeated for per_kernel device code splitting.
44
//
55
// REQUIRES: (target-nvidia || target-amd || target-native_cpu) && any-target-is-spir
6-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if any-target-is-amd %{ %{hip_arch_opts} %} -o %t1.out %s
6+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if target-amd %{ %{hip_arch_opts} %} -o %t1.out %s
77
// RUN: %{run} %t1.out
88
//
9-
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if any-target-is-amd %{ %{hip_arch_opts} %} -o %t2.out %s
9+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if target-amd %{ %{hip_arch_opts} %} -o %t2.out %s
1010
// RUN: %{run} %t2.out
1111
//
12-
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if any-target-is-amd %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t3.out %s
12+
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if target-amd %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t3.out %s
1313
// RUN: %{run} %t3.out
1414
//
15-
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if any-target-is-amd %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t4.out %s
15+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if target-amd %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t4.out %s
1616
// RUN: %{run} %t4.out
1717

1818
#include <sycl/detail/core.hpp>

sycl/test-e2e/format.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ def execute(self, test, litConfig):
221221
build_targets.add(test.config.backend_to_target[backend])
222222

223223
triples = set(test.config.target_to_triple[t] for t in build_targets)
224+
test.config.available_features = test.config.available_features.union(
225+
build_targets
226+
)
224227

225228
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
226229

0 commit comments

Comments
 (0)