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

Commit c2d58b9

Browse files
author
Alexander Batashev
committed
Merge branch 'intel' into xpti_tests
2 parents 1e5f8f3 + 21f8205 commit c2d58b9

File tree

529 files changed

+10173
-2632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

529 files changed

+10173
-2632
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SYCL/AOT @AGindinson @dm-vodopyanov @AlexeySachkov @romanovvlad
77
SYCL/AtomicRef @AGindinson
88

99
# SYCL RT specific tests
10+
SYCL/Assert @intel/llvm-reviewers-runtime
1011
SYCL/Basic @intel/llvm-reviewers-runtime
1112
SYCL/Config @intel/llvm-reviewers-runtime
1213
SYCL/FilterSelector @intel/llvm-reviewers-runtime
@@ -22,20 +23,21 @@ SYCL/DeviceCodeSplit @AlexeySachkov @Fznamznon
2223

2324
# Device library
2425
SYCL/DeviceLib @vzakhari
26+
SYCL/DeviceLib/ITTAnnotations @vzakhari @MrSidims @AGindinson
2527

2628
# dot_product API
2729
SYCL/DotProduct @rdeodhar
2830

2931
# Explicit SIMD
30-
SYCL/ESIMD @kbobrovs @DenisBakhvalov
32+
SYCL/ESIMD @kbobrovs @v-klochkov
3133

3234
# Functor
3335
SYCL/Functor @AlexeySachkov
3436

3537
# Group algorithms
3638
SYCL/GroupAlgorithm @Pennycook @AlexeySachkov
3739
SYCL/SubGroup @Pennycook @AlexeySachkov
38-
SYCL/GroupMask @Pennycook @vladimilaz
40+
SYCL/SubGroupMask @Pennycook @vladimilaz
3941

4042
# Group local memory
4143
SYCL/GroupLocalMemory @sergey-semenov @Pennycook

SYCL/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
BasedOnStyle: LLVM
2-
CommentPragmas: "(RUN|FAIL|REQUIRES|UNSUPPORTED|CHECK) *:|expected-"
2+
CommentPragmas: "(RUN|FAIL|REQUIRES|UNSUPPORTED|CHECK[A-Za-z0-9_-]*) *:|expected-"

SYCL/AOT/accelerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
// REQUIRES: aoc, accelerator
1010

11-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %S/Inputs/aot.cpp -o %t.out
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga %S/Inputs/aot.cpp -o %t.out
1212
// RUN: %ACC_RUN_PLACEHOLDER %t.out

SYCL/AOT/cpu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
// REQUIRES: opencl-aot, cpu
1010

11-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %S/Inputs/aot.cpp -o %t.out
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out
1212
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1313

1414
// Test that opencl-aot can handle multiple build options.
15-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %S/Inputs/aot.cpp -Xsycl-target-backend "--bo=-g" -Xsycl-target-backend "--bo=-cl-opt-disable" -o %t2.out
15+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -Xsycl-target-backend "--bo=-g" -Xsycl-target-backend "--bo=-cl-opt-disable" -o %t2.out

SYCL/AOT/gpu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
// UNSUPPORTED: cuda
1111
// CUDA is not compatible with SPIR.
1212
//
13-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device *" %S/Inputs/aot.cpp -o %t.out
13+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/aot.cpp -o %t.out
1414
// RUN: %GPU_RUN_PLACEHOLDER %t.out

SYCL/AOT/multiple-devices.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,54 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator, llvm-link, llvm-spirv
9+
// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator
1010
// UNSUPPORTED: cuda
1111
// CUDA is not compatible with SPIR.
1212

13-
// 1-command compilation case
14-
// Targeting CPU, GPU, FPGA
15-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device *" %S/Inputs/aot.cpp -o %t_all.out
16-
// RUN: %HOST_RUN_PLACEHOLDER %t_all.out
17-
// RUN: %CPU_RUN_PLACEHOLDER %t_all.out
18-
// RUN: %GPU_RUN_PLACEHOLDER %t_all.out
19-
// RUN: %ACC_RUN_PLACEHOLDER %t_all.out
13+
// Produce a fat object for all targets (generic SPIR-V, CPU, GPU, FPGA)
14+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen,spir64_fpga %S/Inputs/aot.cpp -c -o %t.o
2015

21-
// FIXME: Change the behavior when proper automation for assert support is
22-
// introduced. For the time being, AOT flow can't detect if specific extension
23-
// is available for this or that device. The automation to be introduced is to
24-
// query native binary generator on specific features.
25-
//
26-
// Produce object file, spirv, device images to combine these differently
27-
// at link-time, thus testing various AOT-compiled images configurations
28-
// RUN: %clangxx -fsycl %S/Inputs/aot.cpp -c -o %t.o
29-
// RUN: %clangxx -fsycl -fsycl-link-targets=spir64-unknown-unknown-sycldevice %t.o -o %t.spv
30-
// AOT-compile device binary images
31-
// Neither of AOT tools can compile several files, hence, here is this
32-
// workaround
33-
// RUN: %llvm_spirv -r %sycl_libs_dir/libsycl-fallback-cassert.spv -o=%T/fallback-cassert.bc
34-
// RUN: %llvm_spirv -r %t.spv -o=%t.bc
35-
// RUN: %llvm_link %t.bc %T/fallback-cassert.bc -o=%t2.bc
36-
// RUN: %llvm_spirv %t2.bc -o=%t.spv
37-
// RUN: opencl-aot %t.spv -o=%t_cpu.ir --device=cpu
38-
// RUN: ocloc -file %t.spv -spirv_input -output %t_gen.out -output_no_suffix -device cfl
39-
// RUN: aoc %t.spv -o %t_fpga.aocx -sycl -dep-files=%t.d
16+
// CPU, GPU, FPGA
17+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen,spir64_fpga -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_all_aot.out
18+
// RUN: %HOST_RUN_PLACEHOLDER %t_all_aot.out
19+
// RUN: %CPU_RUN_PLACEHOLDER %t_all_aot.out
20+
// RUN: %GPU_RUN_PLACEHOLDER %t_all_aot.out
21+
// RUN: %ACC_RUN_PLACEHOLDER %t_all_aot.out
4022

4123
// CPU, GPU
42-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_x86_64:%t_cpu.ir,spir64_gen:%t_gen.out %t.o -o %t_cpu_gpu.out
24+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_cpu_gpu.out
4325
// RUN: %HOST_RUN_PLACEHOLDER %t_cpu_gpu.out
4426
// RUN: %CPU_RUN_PLACEHOLDER %t_cpu_gpu.out
4527
// RUN: %GPU_RUN_PLACEHOLDER %t_cpu_gpu.out
4628

4729
// CPU, FPGA
48-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_x86_64:%t_cpu.ir,spir64_fpga:%t_fpga.aocx %t.o -o %t_cpu_fpga.out
30+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_fpga %t.o -o %t_cpu_fpga.out
4931
// RUN: %HOST_RUN_PLACEHOLDER %t_cpu_fpga.out
5032
// RUN: %CPU_RUN_PLACEHOLDER %t_cpu_fpga.out
5133
// RUN: %ACC_RUN_PLACEHOLDER %t_cpu_fpga.out
5234

5335
// GPU, FPGA
54-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64_gen:%t_gen.out,spir64_fpga:%t_fpga.aocx %t.o -o %t_gpu_fpga.out
36+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen,spir64_fpga -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_gpu_fpga.out
5537
// RUN: %HOST_RUN_PLACEHOLDER %t_gpu_fpga.out
5638
// RUN: %GPU_RUN_PLACEHOLDER %t_gpu_fpga.out
5739
// RUN: %ACC_RUN_PLACEHOLDER %t_gpu_fpga.out
5840

5941
// No AOT-compiled image for CPU
60-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_gen:%t_gen.out,spir64_fpga:%t_fpga.aocx %t.o -o %t_spv_gpu_fpga.out
42+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen,spir64_fpga -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_spv_gpu_fpga.out
6143
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_gpu_fpga.out
6244
// Check that execution on AOT-compatible devices is unaffected
6345
// RUN: %GPU_RUN_PLACEHOLDER %t_spv_gpu_fpga.out
6446
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_gpu_fpga.out
6547

6648
// No AOT-compiled image for GPU
67-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_x86_64:%t_cpu.ir,spir64_fpga:%t_fpga.aocx %t.o -o %t_spv_cpu_fpga.out
49+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_fpga %t.o -o %t_spv_cpu_fpga.out
6850
// RUN: %GPU_RUN_PLACEHOLDER %t_spv_cpu_fpga.out
6951
// Check that execution on AOT-compatible devices is unaffected
7052
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_cpu_fpga.out
7153
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_cpu_fpga.out
7254

7355
// No AOT-compiled image for FPGA
74-
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.spv,spir64_x86_64:%t_cpu.ir,spir64_gen:%t_gen.out %t.o -o %t_spv_cpu_gpu.out
56+
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %t.o -o %t_spv_cpu_gpu.out
7557
// RUN: %ACC_RUN_PLACEHOLDER %t_spv_cpu_gpu.out
7658
// Check that execution on AOT-compatible devices is unaffected
7759
// RUN: %CPU_RUN_PLACEHOLDER %t_spv_cpu_gpu.out

SYCL/AOT/with-llvm-bc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
// REQUIRES: cpu, dump_ir
1010

11-
// RUN: %clangxx -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -c %S/Inputs/aot.cpp -o %t.o
12-
// RUN: %clangxx -fsycl -fsycl-link-targets=spir64-unknown-unknown-sycldevice %t.o -o %t.spv
11+
// RUN: %clangxx -fsycl -fsycl-targets=spir64 -c %S/Inputs/aot.cpp -o %t.o
12+
// RUN: %clangxx -fsycl -fsycl-link-targets=spir64 %t.o -o %t.spv
1313
// RUN: llvm-spirv -r %t.spv -o %t.bc
1414
// RUN: %clangxx -fsycl -fsycl-add-targets=spir64:%t.bc %t.o -o %t.out
1515
//
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include "kernels_in_file2.hpp"
2+
3+
#ifdef DEFINE_NDEBUG_INFILE2
4+
#define NDEBUG
5+
#else
6+
#undef NDEBUG
7+
#endif
8+
9+
#include <cassert>
10+
11+
using namespace cl::sycl;
12+
using namespace cl::sycl::access;
13+
14+
int calculus(int X) {
15+
assert(X && "this message from calculus");
16+
return X * 2;
17+
}
18+
19+
void check_nil(int value) { assert(value && "this message from file2"); }
20+
21+
static constexpr size_t BUFFER_SIZE = 4;
22+
23+
void enqueueKernel_1_fromFile2(queue *Q) {
24+
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
25+
cl::sycl::buffer<int, 1> Buf(numOfItems);
26+
27+
Q->submit([&](handler &CGH) {
28+
auto Acc = Buf.template get_access<mode::read_write>(CGH);
29+
30+
CGH.parallel_for<class kernel1_from_separate_file>(
31+
numOfItems, [=](cl::sycl::id<1> wiID) { check_nil(Acc[wiID]); });
32+
});
33+
}
34+
35+
void enqueueKernel_2_fromFile2(queue *Q) {
36+
cl::sycl::range<1> numOfItems{BUFFER_SIZE};
37+
cl::sycl::buffer<int, 1> Buf(numOfItems);
38+
39+
Q->submit([&](handler &CGH) {
40+
auto Acc = Buf.template get_access<mode::read_write>(CGH);
41+
42+
CGH.parallel_for<class kernel2_from_separate_file>(
43+
numOfItems, [=](cl::sycl::id<1> wiID) { check_nil(Acc[wiID]); });
44+
});
45+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <CL/sycl.hpp>
2+
3+
SYCL_EXTERNAL int calculus(int X);
4+
5+
void enqueueKernel_1_fromFile2(sycl::queue *Q);
6+
7+
void enqueueKernel_2_fromFile2(sycl::queue *Q);

SYCL/Assert/assert_in_kernels.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// REQUIRES: linux
2+
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: cuda || hip
4+
// RUN: %clangxx -DSYCL_ENABLE_FALLBACK_ASSERT -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
6+
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
7+
// RUN: %GPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
8+
// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
9+
// Shouldn't fail on ACC as fallback assert isn't enqueued there
10+
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
11+
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
12+
//
13+
// CHECK-NOT: One shouldn't see this message
14+
// CHECK: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
15+
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
16+
// CHECK-NOT: test aborts earlier, one shouldn't see this message
17+
// CHECK-NOT: The test ended.
18+
//
19+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: void kernelFunc2(int *, int): global id: [{{[0,2]}},0,0], local id: [0,0,0]
20+
// CHECK-ACC: The test ended.
21+
22+
#include "assert_in_kernels.hpp"

SYCL/Assert/assert_in_kernels.hpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#include <CL/sycl.hpp>
2+
#include <cassert>
3+
#include <iostream>
4+
5+
using namespace cl::sycl;
6+
using namespace cl::sycl::access;
7+
8+
void kernelFunc1(int *Buf, int wiID) {
9+
Buf[wiID] = 9;
10+
assert(Buf[wiID] != 0 && "One shouldn't see this message");
11+
}
12+
13+
void assertTest1(queue &Q, buffer<int, 1> &Buf) {
14+
Q.submit([&](handler &CGH) {
15+
auto Acc = Buf.template get_access<mode::read_write>(CGH);
16+
17+
CGH.parallel_for<class Kernel_1>(
18+
Buf.get_range(),
19+
[=](cl::sycl::id<1> wiID) { kernelFunc1(&Acc[0], wiID); });
20+
});
21+
}
22+
23+
void kernelFunc2(int *Buf, int wiID) {
24+
if (wiID % 2 != 0)
25+
Buf[wiID] = 0;
26+
assert(Buf[wiID] == 0 && "from assert statement");
27+
}
28+
29+
void assertTest2(queue &Q, buffer<int, 1> &Buf) {
30+
Q.submit([&](handler &CGH) {
31+
auto Acc = Buf.template get_access<mode::read_write>(CGH);
32+
33+
CGH.parallel_for<class Kernel_2>(
34+
Buf.get_range(),
35+
[=](cl::sycl::id<1> wiID) { kernelFunc2(&Acc[0], wiID); });
36+
});
37+
}
38+
39+
void kernelFunc3(int *Buf, int wiID) {
40+
if (wiID == 0)
41+
assert(false && "test aborts earlier, one shouldn't see this message");
42+
Buf[wiID] = 9;
43+
}
44+
45+
void assertTest3(queue &Q, buffer<int, 1> &Buf) {
46+
Q.submit([&](handler &CGH) {
47+
auto Acc = Buf.template get_access<mode::read_write>(CGH);
48+
49+
CGH.parallel_for<class Kernel_3>(
50+
Buf.get_range(),
51+
[=](cl::sycl::id<1> wiID) { kernelFunc3(&Acc[0], wiID); });
52+
});
53+
}
54+
55+
int main(int Argc, const char *Argv[]) {
56+
std::array<int, 4> Vec = {1, 2, 3, 4};
57+
cl::sycl::range<1> numOfItems{Vec.size()};
58+
cl::sycl::buffer<int, 1> Buf(Vec.data(), numOfItems);
59+
60+
queue Q;
61+
assertTest1(Q, Buf);
62+
Q.wait();
63+
64+
assertTest2(Q, Buf);
65+
Q.wait();
66+
67+
assertTest3(Q, Buf);
68+
Q.wait();
69+
70+
std::cout << "The test ended." << std::endl;
71+
return 0;
72+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
2+
// UNSUPPORTED: cuda || hip
3+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DNDEBUG %S/assert_in_kernels.cpp -o %t.out
4+
// RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER
5+
// RUN: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out %ACC_CHECK_PLACEHOLDER
7+
//
8+
// CHECK-NOT: One shouldn't see this message
9+
// CHECK-NOT: from assert statement
10+
// CHECK-NOT: test aborts earlier, one shouldn't see this message
11+
// CHECK: The test ended.

SYCL/Assert/assert_in_kernels_win.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// REQUIRES: windows
2+
// UNSUPPORTED: cuda || hip
3+
// RUN: %clangxx -DSYCL_ENABLE_FALLBACK_ASSERT -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
4+
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
5+
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
6+
// RUN: %GPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
7+
// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
8+
// Shouldn't fail on ACC as fallback assert isn't enqueued there
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
10+
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
11+
//
12+
// CHECK-NOT: One shouldn't see this message
13+
// FIXME Windows version prints '(null)' instead of '<unknown func>' once in a
14+
// while for some insane reason.
15+
// CHECK: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
16+
// CHECK-SAME: Assertion `Buf[wiID] == 0 && "from assert statement"` failed.
17+
// CHECK-NOT: test aborts earlier, one shouldn't see this message
18+
// CHECK-NOT: The test ended.
19+
//
20+
// CHECK-ACC-NOT: {{.*}}assert_in_kernels.hpp:26: {{<unknown func>|(null)}}: global id: [{{[0,2]}},0,0], local id: [0,0,0]
21+
// CHECK-ACC: The test ended.
22+
23+
#include "assert_in_kernels.hpp"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// REQUIRES: linux
2+
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
3+
// UNSUPPORTED: cuda || hip
4+
// RUN: %clangxx -DSYCL_ENABLE_FALLBACK_ASSERT -fsycl -fsycl-targets=%sycl_triple -I %S/Inputs %s %S/Inputs/kernels_in_file2.cpp -o %t.out
5+
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
6+
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
7+
// RUN: %GPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
8+
// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
9+
// Shouldn't fail on ACC as fallback assert isn't enqueued there
10+
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt
11+
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --check-prefix=CHECK-ACC --input-file %t.txt
12+
//
13+
// CHECK: {{.*}}kernels_in_file2.cpp:15: int calculus(int): global id: [5,0,0], local id: [1,0,0]
14+
// CHECK-SAME: Assertion `X && "this message from calculus"` failed.
15+
// CHECK-NOT: this message from file2
16+
// CHECK-NOT: The test ended.
17+
//
18+
// CHECK-ACC-NOT: {{.*}}kernels_in_file2.cpp:15: int calculus(int): global id: [5,0,0], local id: [1,0,0]
19+
// CHECK-ACC: The test ended.
20+
21+
#include "assert_in_multiple_tus.hpp"

0 commit comments

Comments
 (0)