File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2
+ // RUN: env SYCL_DEVICE_FILTER="" %t.out
3
+
4
+ #include < sycl/sycl.hpp>
5
+ using namespace sycl ;
6
+
7
+ int refuse_any_device_f (const device &d) { return -1 ; }
8
+
9
+ int main () {
10
+
11
+ // Check exception message for custom device selector
12
+ try {
13
+ queue custom_queue (refuse_any_device_f);
14
+ } catch (exception &E) {
15
+ assert (std::string (E.what ()).find (" info::device_type::" ) ==
16
+ std::string::npos &&
17
+ " Incorrect device type in exception message for custom selector." );
18
+ }
19
+
20
+ // Check exception message for pre-defined devices
21
+ try {
22
+ queue gpu_queue (gpu_selector_v);
23
+ } catch (exception &E) {
24
+ assert (std::string (E.what ()).find (" info::device_type::gpu" ) !=
25
+ std::string::npos &&
26
+ " Incorrect device type in exception message for GPU device." );
27
+ }
28
+ try {
29
+ queue cpu_queue (cpu_selector_v);
30
+ } catch (exception &E) {
31
+ assert (std::string (E.what ()).find (" info::device_type::cpu" ) !=
32
+ std::string::npos &&
33
+ " Incorrect device type in exception message for CPU device." );
34
+ }
35
+ try {
36
+ queue acc_queue (accelerator_selector_v);
37
+ } catch (exception &E) {
38
+ assert (
39
+ std::string (E.what ()).find (" info::device_type::accelerator" ) !=
40
+ std::string::npos &&
41
+ " Incorrect device type in exception message for Accelerator device." );
42
+ }
43
+
44
+ return 0 ;
45
+ }
You can’t perform that action at this time.
0 commit comments