Skip to content

Commit fc5db6b

Browse files
[SYCL][E2E] Fix tests with separate compilation and add -fno-fast-math flag to them (#10090)
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 370aa2a commit fc5db6b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
12
// UNSUPPORTED: gpu
2-
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o
3-
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -Wno-sycl-strict
3+
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o %{mathflags}
4+
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -Wno-sycl-strict %{mathflags}
45
// >> host compilation...
5-
// RUN: %clangxx %cxx_std_optionc++17 %include_option std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o %sycl_options -Wno-sycl-strict
6-
// RUN: %clangxx %t_host.o %t_device.o -o %t.out %sycl_options
6+
// RUN: %clangxx %cxx_std_optionc++17 %include_option std_complex_math_test_ihdr.h -c %S/std_complex_math_test.cpp -o %t_host.o %sycl_options -Wno-sycl-strict %{mathflags}
7+
// RUN: %clangxx %t_host.o %t_device.o -o %t.out %sycl_options %{mathflags}
78
// RUN: %{run} %t.out
89

9-
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o
10-
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_fp64_test_ihdr.h %S/std_complex_math_fp64_test.cpp -Wno-sycl-strict
10+
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o %{mathflags}
11+
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_fp64_test_ihdr.h %S/std_complex_math_fp64_test.cpp -Wno-sycl-strict %{mathflags}
1112
// >> host compilation...
12-
// RUN: %clangxx %cxx_std_optionc++17 %include_option std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o %sycl_options -Wno-sycl-strict
13-
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out %sycl_options
13+
// RUN: %clangxx %cxx_std_optionc++17 %include_option std_complex_math_fp64_test_ihdr.h -c %S/std_complex_math_fp64_test.cpp -o %t_fp64_host.o %sycl_options -Wno-sycl-strict %{mathflags}
14+
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out %sycl_options %{mathflags}
1415
// RUN: %{run} %t.out

sycl/test-e2e/DeviceLib/std_complex_math_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
12
// UNSUPPORTED: gpu
2-
// RUN: %{build} -o %t.out
3+
// RUN: %{build} %{mathflags} -o %t.out
34
// RUN: %{run} %t.out
45

5-
// RUN: %{build} -fsycl-device-lib-jit-link -o %t.out
6+
// RUN: %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t.out
67
// RUN: %{run} %t.out
78

89
#include <array>

sycl/test-e2e/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
config.substitutions.append( ('%opencl_include_dir', config.opencl_include_dir) )
197197

198198
if cl_options:
199-
config.substitutions.append( ('%sycl_options', ' ' + config.sycl_libs_dir + '/../lib/sycl7.lib /I' +
199+
config.substitutions.append( ('%sycl_options', ' ' + os.path.normpath(os.path.join(config.sycl_libs_dir + '/../lib/sycl7.lib')) + ' /I' +
200200
config.sycl_include + ' /I' + os.path.join(config.sycl_include, 'sycl')) )
201201
config.substitutions.append( ('%include_option', '/FI' ) )
202202
config.substitutions.append( ('%debug_option', '/DEBUG' ) )

0 commit comments

Comments
 (0)