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

Commit 04b6050

Browse files
[SYCL] Add test for default async_handler (#1351)
Test for intel/llvm#7162.
1 parent 3d696bb commit 04b6050

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %CPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
3+
// RUN: %CPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out &> %t.txt || true
5+
// RUN: %GPU_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
6+
// RUN: %ACC_RUN_PLACEHOLDER %t.out &> %t.txt || true
7+
// RUN: %ACC_RUN_PLACEHOLDER FileCheck %s --input-file %t.txt
8+
9+
#include <sycl/sycl.hpp>
10+
11+
using namespace sycl;
12+
13+
int main() {
14+
queue Q;
15+
Q.submit([&](handler &CGH) {
16+
CGH.host_task([=]() {
17+
throw std::runtime_error("Exception thrown from host_task.");
18+
});
19+
}).wait_and_throw();
20+
return 0;
21+
}
22+
23+
// CHECK: Default async_handler caught exceptions:
24+
// CHECK-NEXT: Exception thrown from host_task.

0 commit comments

Comments
 (0)