File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: gpu
2
+
3
+ // RUN: %clangxx -fsycl %s -o %t.out
4
+ // RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
5
+
6
+ #include < CL/sycl.hpp>
7
+
8
+ int main () {
9
+ const auto GlobalRange = 1 ;
10
+ const auto LocalRange = 2 ;
11
+
12
+ sycl::queue myQueue{sycl::gpu_selector{}, [](sycl::exception_list elist) {
13
+ for (auto e : elist)
14
+ std::rethrow_exception (e);
15
+ }};
16
+
17
+ try {
18
+ // Generating an exception caused by the fact that LocalRange size (== 2)
19
+ // can't be greater than GlobalRange size (== 1)
20
+ myQueue.parallel_for <class TestKernel >(
21
+ sycl::nd_range<1 >{sycl::range<1 >(GlobalRange),
22
+ sycl::range<1 >(LocalRange)},
23
+ [=](sycl::nd_item<1 > idx) {});
24
+ myQueue.wait_and_throw ();
25
+ assert (false && " Expected exception was not caught" );
26
+ } catch (sycl::exception &e) {
27
+ }
28
+
29
+ return 0 ;
30
+ }
31
+
32
+ // CHECK:---> piContextRelease(
You can’t perform that action at this time.
0 commit comments