Skip to content

Commit 63214a6

Browse files
update the test to test backward compatibility
1 parent c787c76 commit 63214a6

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ endif()
109109

110110
set(spv_device_compile_opts -fsycl-device-only -fsycl-device-obj=spirv)
111111
set(bc_device_compile_opts -fsycl-device-only -fsycl-device-obj=llvmir)
112-
set(obj-old-offload_device_compile_opts -fsycl -c ${sycl_targets_opt})
112+
set(obj-old-offload_device_compile_opts -fsycl -c ${sycl_targets_opt} --no-offload-new-driver)
113113
set(obj_device_compile_opts -fsycl -c --offload-new-driver
114114
-foffload-lto=thin ${sycl_targets_opt})
115115

@@ -397,17 +397,17 @@ if (NOT MSVC AND UR_SANITIZER_INCLUDE_DIR)
397397
${sanitizer_generic_compile_opts}
398398
-D__LIBDEVICE_DG2__)
399399

400-
set(sanitizer_pvc_compile_opts_obj-old-offload -fsycl -c
400+
set(sanitizer_pvc_compile_opts_obj-old-offload -fsycl -c --no-offload-new-driver
401401
${sanitizer_generic_compile_opts}
402402
${sycl_pvc_target_opt}
403403
-D__LIBDEVICE_PVC__)
404404

405-
set(sanitizer_cpu_compile_opts_obj-old-offload -fsycl -c
405+
set(sanitizer_cpu_compile_opts_obj-old-offload -fsycl -c --no-offload-new-driver
406406
${sanitizer_generic_compile_opts}
407407
${sycl_cpu_target_opt}
408408
-D__LIBDEVICE_CPU__)
409409

410-
set(sanitizer_dg2_compile_opts_obj-old-offload -fsycl -c
410+
set(sanitizer_dg2_compile_opts_obj-old-offload -fsycl -c --no-offload-new-driver
411411
${sanitizer_generic_compile_opts}
412412
${sycl_dg2_target_opt}
413413
-D__LIBDEVICE_DG2__)
@@ -707,7 +707,7 @@ if (NOT WIN32)
707707
add_imf_host_cxx_flags_compile_flags_if_supported("-fcf-protection=full")
708708
endif()
709709

710-
set(obj-old-offload_host_compile_opts ${imf_host_cxx_flags})
710+
set(obj-old-offload_host_compile_opts ${imf_host_cxx_flags} --no-offload-new-driver)
711711
set(obj_host_compile_opts ${imf_host_cxx_flags})
712712

713713
foreach(datatype IN ITEMS fp32 fp64 bf16)

sycl/test-e2e/Config/kernel_from_file.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -Xclang -verify-ignore-unexpected=note,warning %if preview-mode %{-Wno-unused-command-line-argument%}
1616
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out
1717

18-
// Check backward compatibility: verify that legacy SYCL object files can be unbundled to extract device code as in previous workflows.
18+
// Check backward compatibility: verify that SYCL object files can be unbundled to extract device code as in old-offloading-model workflows.
1919
// >> ---- unbundle compiler wrapper and asan device objects
20-
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-compiler-wrappers%obj_ext -output=%t_compiler_wrappers.bc -unbundle
21-
// RUN: %if linux %{ clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-asan%obj_ext -output=%t_asan.bc -unbundle %}
20+
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-compiler-wrappers.old%obj_ext -output=%t_compiler_wrappers.old.bc -unbundle
21+
// RUN: %if linux %{ clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-asan.old%obj_ext -output=%t_asan.old.bc -unbundle %}
2222

2323
// >> ---- link device code
24-
// RUN: %if linux %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %t_asan.bc %} %else %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %}
24+
// RUN: %if linux %{ llvm-link -o=%t_app.old.bc %t.bc %t_compiler_wrappers.old.bc %t_asan.old.bc %} %else %{ llvm-link -o=%t_app.old.bc %t.bc %t_compiler_wrappers.old.bc %}
25+
26+
// >> ---- translate to SPIR-V
27+
// RUN: llvm-spirv -o %t.old.spv %t_app.old.bc
28+
// RUN: env SYCL_USE_KERNEL_SPV=%t.old.spv %{run} %t.out
2529

2630

2731
#include <iostream>

sycl/test-e2e/SeparateCompile/test.cpp

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// RUN: llvm-link -o=app.bc a_kernel.bc b_kernel.bc %sycl_static_libs_dir/libsycl-itt-compiler-wrappers.bc %sycl_static_libs_dir/libsycl-itt-stubs.bc %sycl_static_libs_dir/libsycl-itt-user-wrappers.bc
2020

2121
// >> ---- produce entries data
22-
// RUN: sycl-post-link -split=auto -emit-param-info -symbols -emit-exported-symbols -o test.table app.bc
22+
// RUN: sycl-post-link -split=auto -emit-param-info -symbols -emit-exported-symbols -o test.table app.bc
2323
//
2424
// >> ---- do table transformations from bc to spv entries
2525
// RUN: file-table-tform -extract=Code -drop_titles -o test_spv_in.table test.table
@@ -37,27 +37,44 @@
3737
// RUN: %clangxx wrapper.o a.o b.o -Wno-unused-command-line-argument -o app.exe %sycl_options
3838
// RUN: %{run} ./app.exe
3939

40-
// Check backward compatibility: verify that legacy SYCL object files can be unbundled to extract device code as in previous workflows.
40+
// Check backward compatibility: verify that SYCL object files can be unbundled to extract device code as in old-offloading-model workflows.
4141
// >> ---- bundle .o with .spv
4242
// >> run bundler
43-
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -input=a.o -input=a_kernel.bc -output=a_fat.o
44-
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -input=b.o -input=b_kernel.bc -output=b_fat.o
43+
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -input=a.o -input=a_kernel.bc -output=a_fat.old.o
44+
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -input=b.o -input=b_kernel.bc -output=b_fat.old.o
4545
//
4646
// >> ---- unbundle fat objects
47-
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -output=a.o -output=a_kernel.bc -input=a_fat.o -unbundle
48-
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -output=b.o -output=b_kernel.bc -input=b_fat.o -unbundle
47+
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -output=a.old.o -output=a_kernel.old.bc -input=a_fat.old.o -unbundle
48+
// RUN: clang-offload-bundler -type=o -targets=host-x86_64,sycl-spir64-pc-linux-gnu -output=b.old.o -output=b_kernel.old.bc -input=b_fat.old.o -unbundle
4949
//
5050
// As we are doing a separate device compilation here, we need to explicitly
5151
// add the device lib instrumentation (itt_compiler_wrapper)
5252
// >> ---- unbundle compiler wrapper device object
53-
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-compiler-wrappers%obj_ext -output=compiler_wrappers.bc -unbundle
54-
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-stubs%obj_ext -output=itt_stubs.bc -unbundle
55-
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-user-wrappers%obj_ext -output=user_wrappers.bc -unbundle
53+
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-compiler-wrappers.old%obj_ext -output=compiler_wrappers.old.bc -unbundle
54+
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-stubs.old%obj_ext -output=itt_stubs.old.bc -unbundle
55+
// RUN: clang-offload-bundler -type=o -targets=sycl-spir64-unknown-unknown -input=%sycl_static_libs_dir/libsycl-itt-user-wrappers.old%obj_ext -output=user_wrappers.old.bc -unbundle
5656
//
5757
// >> ---- link device code
58-
// RUN: llvm-link -o=app.bc a_kernel.bc b_kernel.bc compiler_wrappers.bc itt_stubs.bc user_wrappers.bc
59-
60-
58+
// RUN: llvm-link -o=app.old.bc a_kernel.old.bc b_kernel.old.bc compiler_wrappers.old.bc itt_stubs.old.bc user_wrappers.old.bc
59+
//
60+
// >> ---- produce entries data
61+
// RUN: sycl-post-link -split=auto -emit-param-info -symbols -emit-exported-symbols -o test.old.table app.old.bc
62+
//
63+
// >> ---- do table transformations from bc to spv entries
64+
// RUN: file-table-tform -extract=Code -drop_titles -o test_spv_in.old.table test.old.table
65+
// RUN: llvm-foreach --in-file-list=test_spv_in.old.table --in-replace=test_spv_in.old.table --out-ext=spv --out-file-list=test_spv_out.old.table --out-replace=test_spv_out.old.table -- llvm-spirv -o test_spv_out.old.table -spirv-allow-extra-diexpressions -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all test_spv_in.old.table
66+
// RUN: file-table-tform -replace=Code,Code -o test_spv.old.table test.old.table test_spv_out.old.table
67+
//
68+
// >> ---- wrap device binary
69+
// >> produce .bc
70+
// RUN: clang-offload-wrapper -o wrapper.old.bc -host=x86_64 -kind=sycl -target=spir64 -batch test_spv.old.table
71+
//
72+
// >> compile .bc to .o
73+
// RUN: %clangxx -Wno-error=override-module -c wrapper.old.bc -o wrapper.old.o %if preview-mode %{-Wno-unused-command-line-argument%}
74+
//
75+
// >> ---- link the full hetero app
76+
// RUN: %clangxx wrapper.old.o a.old.o b.old.o -Wno-unused-command-line-argument -o app.old.exe %sycl_options
77+
// RUN: %{run} ./app.old.exe
6178

6279
//==----------- test.cpp - Tests SYCL separate compilation -----------------==//
6380
//

sycl/test-e2e/lit.cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ def __exit__(self, exc_type, exc_value, exc_traceback):
213213
config.substitutions.append(
214214
("%sycl_static_libs_dir", config.sycl_libs_dir + "/../lib")
215215
)
216-
config.substitutions.append(("%obj_ext", ".old.obj"))
216+
config.substitutions.append(("%obj_ext", ".obj"))
217217
config.substitutions.append(
218218
("%sycl_include", "-Xclang -isystem -Xclang " + config.sycl_include)
219219
)
220220
elif platform.system() == "Linux":
221221
config.substitutions.append(("%sycl_static_libs_dir", config.sycl_libs_dir))
222-
config.substitutions.append(("%obj_ext", ".old.o"))
222+
config.substitutions.append(("%obj_ext", ".o"))
223223
config.substitutions.append(("%sycl_include", "-isystem " + config.sycl_include))
224224

225225
# Intel GPU FAMILY availability

0 commit comments

Comments
 (0)