Skip to content

Commit e0314fe

Browse files
[SYCL][E2E] Fix preview flag testing for non-HIP and non-CUDA devices (#11978)
The preview flag testing for E2E testing is currently broken. #11929 attempts to fix it but has shown that some breakages in CUDA and HIP have been hidden behind the broken testing. To allow for proper testing while these failures are being investigated, this PR implements the fixes from #11929 with the caveat that they do not apply when HIP and CUDA devices are part of the testing. This is a temporary solution and does *not* replace #11929. --------- Signed-off-by: Larsen, Steffen <[email protected]> Co-authored-by: Chris Perkins <[email protected]>
1 parent 38f4d91 commit e0314fe

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

sycl/test-e2e/Basic/vector/int-convert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// RUN: %{build} -o %t.out -DSYCL2020_DISABLE_DEPRECATION_WARNINGS
1111
// RUN: %{run} %t.out
1212
//
13-
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -DSYCL2020_DISABLE_DEPRECATION_WARNINGS %s -o %t2.out %}
14-
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
13+
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -DSYCL2020_DISABLE_DEPRECATION_WARNINGS %s -o %t2.out %}
14+
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
1515

1616
#include <sycl/sycl.hpp>
1717

sycl/test-e2e/DeviceLib/built-ins/scalar_integer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33

4-
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
4+
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %s -o %t2.out %}
55
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
66

77
#include <sycl/sycl.hpp>

sycl/test-e2e/PreviewBreakingChanges/preview_lib_marker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: preview-breaking-changes-supported
22

3-
// RUN: %clangxx -fsycl -fpreview-breaking-changes %s -o %t
3+
// RUN: %clangxx -fsycl -fpreview-breaking-changes %s -o %t.out
44
// RUN: %{run} %t.out
55

66
// Test to help identify that E2E testing correctly detects and uses the preview

sycl/test-e2e/Regression/vec_logical_ops.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
3-
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes && ./%t.out %}
3+
4+
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %s -o %t2.out %}
5+
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
46

57
#include <sycl/sycl.hpp>
68

sycl/test-e2e/USM/math.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{build} -o %t.out
33
// RUN: %{run} %t.out
44

5-
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
5+
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %s -o %t2.out %}
66
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
77

88
#include <sycl/sycl.hpp>

sycl/test-e2e/format.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ def get_extra_env(sycl_devices):
181181

182182
substitutions.append(('%{run-unfiltered-devices}', run_unfiltered_substitution))
183183

184+
185+
# Temporary fix due to failures in CUDA and HIP behind preview flag.
186+
if ((('ext_oneapi_cuda:gpu' in devices_for_test) or
187+
('ext_oneapi_hip:gpu' in devices_for_test)) and
188+
('preview-breaking-changes-supported' in test.config.available_features)):
189+
test.config.available_features.remove('preview-breaking-changes-supported')
190+
184191
new_script = []
185192
for directive in script:
186193
if not isinstance(directive, lit.TestRunner.CommandDirective):
@@ -203,9 +210,9 @@ def get_extra_env(sycl_devices):
203210
# Expand device-specific condtions (%if ... %{ ... %}).
204211
tmp_script = [ cmd ]
205212
conditions = {x: True for x in sycl_device.split(':')}
206-
for op_sys in ['linux', 'windows']:
207-
if op_sys in test.config.available_features:
208-
conditions[op_sys] = True
213+
for cond_features in ['linux', 'windows', 'preview-breaking-changes-supported']:
214+
if cond_features in test.config.available_features:
215+
conditions[cond_features] = True
209216

210217
tmp_script = lit.TestRunner.applySubstitutions(
211218
tmp_script, [], conditions, recursion_limit=test.config.recursiveExpansionLimit)

sycl/test-e2e/lit.cfg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@
177177
# Check for sycl-preview library
178178
check_preview_breaking_changes_file='preview_breaking_changes_link.cpp'
179179
with open(check_preview_breaking_changes_file, 'w') as fp:
180-
fp.write('#include <sycl/sycl.hpp>')
181-
fp.write('namespace sycl { inline namespace _V1 { namespace detail {')
182-
fp.write('extern void PreviewMajorReleaseMarker();')
183-
fp.write('}}}')
184-
fp.write('int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }')
180+
fp.write('#include <sycl/sycl.hpp>\n')
181+
fp.write('namespace sycl { inline namespace _V1 { namespace detail {\n')
182+
fp.write('extern void PreviewMajorReleaseMarker();\n')
183+
fp.write('}}}\n')
184+
fp.write('int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }\n')
185185

186186
sp = subprocess.getstatusoutput(config.dpcpp_compiler+' -fsycl -fpreview-breaking-changes ' + check_preview_breaking_changes_file)
187187
if sp[0] == 0:

0 commit comments

Comments
 (0)