Skip to content

Commit 68df2eb

Browse files
Adjust kernel_from_file test
1 parent 3157885 commit 68df2eb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

sycl/test-e2e/Config/kernel_from_file.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// REQUIRES: target-spir
22

3-
// FIXME Disabled fallback assert as it'll require either online linking or
4-
// explicit offline linking step here
53
// FIXME separate compilation requires -fno-sycl-dead-args-optimization
64
// As we are doing a separate device compilation here, we need to explicitly
75
// add the device lib instrumentation (itt_compiler_wrapper)
8-
// RUN: %clangxx -Wno-error=ignored-attributes -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fno-sycl-dead-args-optimization -Xclang -fsycl-int-header=%t.h %s -o %t.bc -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
6+
// RUN: %clangxx -Wno-error=ignored-attributes -DUSED_KERNEL -fno-sycl-dead-args-optimization %cxx_std_optionc++17 -fsycl-device-only -Xclang -fsycl-int-header=%t.h %s -o %t.bc -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict
97
// >> ---- unbundle compiler wrapper and asan device objects
108
// 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
119
// 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 %}
1210
// >> ---- link device code
1311
// 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 %}
1412
// >> ---- translate to SPIR-V
1513
// RUN: llvm-spirv -o %t.spv %t_app.bc
16-
// 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%}
14+
// Need to perform full compilation here since the SYCL runtime uses image
15+
// properties from the fat binary.
16+
// RUN: %{build} -fno-sycl-dead-args-optimization -o %t.out
1717
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out
1818

1919
#include <iostream>
@@ -31,10 +31,15 @@ int main(int argc, char **argv) {
3131
event e = myQueue.submit([&](handler &cgh) {
3232
auto ptr = buf.get_access<access::mode::read_write>(cgh);
3333

34-
cgh.single_task<class my_kernel>([=]() { ptr[0]++; });
34+
cgh.single_task<class my_kernel>([=]() {
35+
#ifdef USED_KERNEL
36+
ptr[0]++;
37+
#else
38+
ptr[0]--;
39+
#endif
40+
});
3541
});
3642
e.wait_and_throw();
37-
3843
} catch (sycl::exception const &e) {
3944
std::cerr << "SYCL exception caught:\n";
4045
std::cerr << e.what() << "\n";

0 commit comments

Comments
 (0)