Skip to content

[SYCL][E2E] Fix preview flag testing for non-HIP and non-CUDA devices #11978

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
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
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/vector/int-convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// RUN: %{build} -o %t.out -DSYCL2020_DISABLE_DEPRECATION_WARNINGS
// RUN: %{run} %t.out
//
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -DSYCL2020_DISABLE_DEPRECATION_WARNINGS %s -o %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -DSYCL2020_DISABLE_DEPRECATION_WARNINGS %s -o %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}

#include <sycl/sycl.hpp>

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceLib/built-ins/scalar_integer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

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

#include <sycl/sycl.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: preview-breaking-changes-supported

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

// Test to help identify that E2E testing correctly detects and uses the preview
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Regression/vec_logical_ops.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes && ./%t.out %}

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

#include <sycl/sycl.hpp>

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/USM/math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

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

#include <sycl/sycl.hpp>
Expand Down
13 changes: 10 additions & 3 deletions sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ def get_extra_env(sycl_devices):

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


# Temporary fix due to failures in CUDA and HIP behind preview flag.
if ((('ext_oneapi_cuda:gpu' in devices_for_test) or
('ext_oneapi_hip:gpu' in devices_for_test)) and
('preview-breaking-changes-supported' in test.config.available_features)):
test.config.available_features.remove('preview-breaking-changes-supported')

new_script = []
for directive in script:
if not isinstance(directive, lit.TestRunner.CommandDirective):
Expand All @@ -203,9 +210,9 @@ def get_extra_env(sycl_devices):
# Expand device-specific condtions (%if ... %{ ... %}).
tmp_script = [ cmd ]
conditions = {x: True for x in sycl_device.split(':')}
for op_sys in ['linux', 'windows']:
if op_sys in test.config.available_features:
conditions[op_sys] = True
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)
Expand Down
10 changes: 5 additions & 5 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@
# Check for sycl-preview library
check_preview_breaking_changes_file='preview_breaking_changes_link.cpp'
with open(check_preview_breaking_changes_file, 'w') as fp:
fp.write('#include <sycl/sycl.hpp>')
fp.write('namespace sycl { inline namespace _V1 { namespace detail {')
fp.write('extern void PreviewMajorReleaseMarker();')
fp.write('}}}')
fp.write('int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }')
fp.write('#include <sycl/sycl.hpp>\n')
fp.write('namespace sycl { inline namespace _V1 { namespace detail {\n')
fp.write('extern void PreviewMajorReleaseMarker();\n')
fp.write('}}}\n')
fp.write('int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }\n')

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