Skip to content

Commit 1e63e24

Browse files
Maetveisbader
andauthored
[SYCL][E2E] Fix -Werror failures in implicitly SPIR only DeviceLib tests (#18995)
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. --------- Co-authored-by: Alexey Bader <alexey.bader@intel.com>
1 parent 87a6699 commit 1e63e24

22 files changed

+35
-35
lines changed

sycl/test-e2e/DeviceImageDependencies/NewOffloadDriver/math_device_lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
44

5-
// RUN: %{build} --offload-new-driver -fsycl-allow-device-image-dependencies -fsycl-device-lib-jit-link %{mathflags} -o %t.out
5+
// RUN: %{build} --offload-new-driver -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link %} %{mathflags} -o %t.out
66
// RUN: %{run} %t.out
77

88
#include <cmath>

sycl/test-e2e/DeviceImageDependencies/math_device_lib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
44

5-
// RUN: %{build} -fsycl-allow-device-image-dependencies -fsycl-device-lib-jit-link %{mathflags} -o %t.out
5+
// RUN: %{build} -fsycl-allow-device-image-dependencies %if target-spir %{ -fsycl-device-lib-jit-link %} %{mathflags} -o %t.out
66
// RUN: %{run} %t.out
77

88
#include <cmath>

sycl/test-e2e/DeviceLib/cmath_fp64_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// RUN: %{build} %{mathflags} -o %t1.out
88
// RUN: %{run} %t1.out
99

10-
// RUN: %{build} -Wno-error=unused-command-line-argument -fsycl-device-lib-jit-link %{mathflags} -o %t2.out
11-
// RUN: %{run} %t2.out
10+
// RUN: %if target-spir %{ %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %}
11+
// RUN: %if target-spir %{ %{run} %t2.out %}
1212

1313
#include "math_utils.hpp"
1414
#include <cmath>

sycl/test-e2e/DeviceLib/cmath_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// RUN: %{build} -fno-builtin %{mathflags} -o %t1.out
66
// RUN: %{run} %t1.out
77

8-
// RUN: %{build} -Wno-error=unused-command-line-argument -fno-builtin -fsycl-device-lib-jit-link %{mathflags} -o %t2.out
9-
// RUN: %if !gpu %{ %{run} %t2.out %}
8+
// RUN: %if target-spir %{ %{build} -fno-builtin -fsycl-device-lib-jit-link %{mathflags} -o %t2.out %}
9+
// RUN: %if target-spir && !gpu %{ %{run} %t2.out %}
1010
//
1111
// // Check that --fast-math works with cmath funcs for CUDA
1212
// RUN: %if target-nvidia %{ %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %s -Wno-nan-infinity-disabled -fno-builtin %{mathflags} -o %t3.out -ffast-math -DSYCL_E2E_FASTMATH %}

sycl/test-e2e/DeviceLib/imf_bfloat16_integeral_convesions.cpp

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

4-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
4+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out
55
// RUN: %{run} %t2.out
66
//
77
// UNSUPPORTED: target-nvidia || target-amd

sycl/test-e2e/DeviceLib/imf_double2bfloat16.cpp

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

6-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t1.out
6+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t1.out
77
// RUN: %{run} %t1.out
88
//
99
// UNSUPPORTED: target-nvidia || target-amd

sycl/test-e2e/DeviceLib/imf_double2half.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %{build} -o %t1.out
55
// RUN: %{run} %t1.out
66

7-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
7+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out
88
// RUN: %{run} %t2.out
99

1010
// UNSUPPORTED: target-nvidia, target-amd

sycl/test-e2e/DeviceLib/imf_float2bfloat16.cpp

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

4-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
4+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out
55
// RUN: %{run} %t2.out
66
//
77
// UNSUPPORTED: target-nvidia || target-amd

sycl/test-e2e/DeviceLib/imf_fp32_rounding_test.cpp

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

4-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
4+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out
55
// RUN: %{run} %t2.out
66
//
77
// UNSUPPORTED: target-nvidia || target-amd

sycl/test-e2e/DeviceLib/imf_fp32_test.cpp

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

4-
// RUN: %{build} -fno-builtin -fsycl-device-lib-jit-link -o %t2.out
4+
// RUN: %{build} -fno-builtin %if target-spir %{ -fsycl-device-lib-jit-link %} -o %t2.out
55
// RUN: %{run} %t2.out
66
//
77
// UNSUPPORTED: target-nvidia || target-amd

0 commit comments

Comments
 (0)