Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Update tests in preparation for default device instrumentation #1017

Merged
merged 3 commits into from
May 12, 2022
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
10 changes: 9 additions & 1 deletion SYCL/Config/kernel_from_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
// FIXME Disabled fallback assert as it'll require either online linking or
// explicit offline linking step here
// FIXME separate compilation requires -fno-sycl-dead-args-optimization
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fno-sycl-use-bitcode -fno-sycl-dead-args-optimization -Xclang -fsycl-int-header=%t.h -c %s -o %t.spv -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
// As we are doing a separate device compilation here, we need to explicitly
// add the device lib instrumentation (itt_compiler_wrapper)
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fsycl-use-bitcode -fno-sycl-dead-args-optimization -Xclang -fsycl-int-header=%t.h -c %s -o %t.bc -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
// >> ---- unbundle compiler wrapper device object
// 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
// >> ---- link device code
// RUN: llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc
// >> ---- translate to SPIR-V
// RUN: llvm-spirv -o %t.spv %t_app.bc
// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -fno-sycl-dead-args-optimization -Xclang -verify-ignore-unexpected=note,warning
// RUN: %BE_RUN_PLACEHOLDER env SYCL_USE_KERNEL_SPV=%t.spv %t.out | FileCheck %s
// CHECK: Passed
Expand Down
7 changes: 6 additions & 1 deletion SYCL/SeparateCompile/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
// 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
// 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
//
// As we are doing a separate device compilation here, we need to explicitly
// add the device lib instrumentation (itt_compiler_wrapper)
// >> ---- unbundle compiler wrapper device object
// 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
//
// >> ---- link device code
// RUN: llvm-link -o=app.bc a_kernel.bc b_kernel.bc
// RUN: llvm-link -o=app.bc a_kernel.bc b_kernel.bc compiler_wrappers.bc
//
// >> convert linked .bc to spirv
// RUN: llvm-spirv -o=app.spv app.bc
Expand Down
6 changes: 6 additions & 0 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
llvm_config.with_environment(var,"")

config.substitutions.append( ('%sycl_libs_dir', config.sycl_libs_dir ) )
if platform.system() == "Windows":
config.substitutions.append( ('%sycl_static_libs_dir', config.sycl_libs_dir + '/../lib' ) )
elif platform.system() == "Linux":
config.substitutions.append( ('%sycl_static_libs_dir', config.sycl_libs_dir ) )
config.substitutions.append( ('%sycl_include', config.sycl_include ) )

if lit_config.params.get('gpu-intel-dg1', False):
Expand Down Expand Up @@ -155,6 +159,7 @@
config.substitutions.append( ('%cxx_std_option', '/std:' ) )
config.substitutions.append( ('%fPIC', '') )
config.substitutions.append( ('%shared_lib', '/LD') )
config.substitutions.append( ('%obj_ext', '.obj') )
else:
config.substitutions.append( ('%sycl_options', ' -lsycl -I' +
config.sycl_include + ' -I' + os.path.join(config.sycl_include, 'sycl') +
Expand All @@ -168,6 +173,7 @@
# configurations
config.substitutions.append( ('%fPIC', ('' if platform.system() == 'Windows' else '-fPIC')) )
config.substitutions.append( ('%shared_lib', '-shared') )
config.substitutions.append( ('%obj_ext', '.o') )

if not config.gpu_aot_target_opts:
config.gpu_aot_target_opts = '"-device *"'
Expand Down