Skip to content
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

[SYCL][E2E] Fix tests with separate compilation and add -fno-fast-math flag to them #10090

Merged
merged 2 commits into from
Jun 28, 2023
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
17 changes: 9 additions & 8 deletions sycl/test-e2e/DeviceLib/separate_compile_test.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
// UNSUPPORTED: gpu
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o
// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=std_complex_math_test_ihdr.h %S/std_complex_math_test.cpp -Wno-sycl-strict
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_test.cpp -o %t_device.o %{mathflags}
// 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}
// >> host compilation...
// 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
// RUN: %clangxx %t_host.o %t_device.o -o %t.out %sycl_options
// 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}
// RUN: %clangxx %t_host.o %t_device.o -o %t.out %sycl_options %{mathflags}
// RUN: %{run} %t.out

// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o
// 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
// RUN: %clangxx -fsycl -fsycl-link %S/std_complex_math_fp64_test.cpp -o %t_fp64_device.o %{mathflags}
// 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}
// >> host compilation...
// 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
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out %sycl_options
// 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}
// RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out %sycl_options %{mathflags}
// RUN: %{run} %t.out
5 changes: 3 additions & 2 deletions sycl/test-e2e/DeviceLib/std_complex_math_test.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
// UNSUPPORTED: gpu
// RUN: %{build} -o %t.out
// RUN: %{build} %{mathflags} -o %t.out
// RUN: %{run} %t.out

// RUN: %{build} -fsycl-device-lib-jit-link -o %t.out
// RUN: %{build} -fsycl-device-lib-jit-link %{mathflags} -o %t.out
// RUN: %{run} %t.out

#include <array>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
config.substitutions.append( ('%opencl_include_dir', config.opencl_include_dir) )

if cl_options:
config.substitutions.append( ('%sycl_options', ' ' + config.sycl_libs_dir + '/../lib/sycl7.lib /I' +
config.substitutions.append( ('%sycl_options', ' ' + os.path.normpath(os.path.join(config.sycl_libs_dir + '/../lib/sycl7.lib')) + ' /I' +
config.sycl_include + ' /I' + os.path.join(config.sycl_include, 'sycl')) )
config.substitutions.append( ('%include_option', '/FI' ) )
config.substitutions.append( ('%debug_option', '/DEBUG' ) )
Expand Down