This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree 1 file changed +34
-3
lines changed
1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change 1
- // RUN: %clangxx -fsycl %s -o %t.out
1
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2
2
// RUN: %t.out
3
3
//
4
4
// ==----------------- get_backend.cpp ------------------------==//
@@ -26,12 +26,43 @@ bool check(backend be) {
26
26
return false ;
27
27
}
28
28
29
+ inline void return_fail () {
30
+ std::cout << " Failed" << std::endl;
31
+ exit (1 );
32
+ }
33
+
29
34
int main () {
30
35
for (const auto &plt : platform::get_platforms ()) {
31
36
if (!plt.is_host ()) {
32
37
if (check (plt.get_backend ()) == false ) {
33
- std::cout << " Failed" << std::endl;
34
- return 1 ;
38
+ return_fail ();
39
+ }
40
+
41
+ context c (plt);
42
+ if (c.get_backend () != plt.get_backend ()) {
43
+ return_fail ();
44
+ }
45
+
46
+ program prog (c);
47
+ if (prog.get_backend () != plt.get_backend ()) {
48
+ return_fail ();
49
+ }
50
+
51
+ default_selector sel;
52
+ queue q (c, sel);
53
+ if (q.get_backend () != plt.get_backend ()) {
54
+ return_fail ();
55
+ }
56
+
57
+ auto device = q.get_device ();
58
+ if (device.get_backend () != plt.get_backend ()) {
59
+ return_fail ();
60
+ }
61
+
62
+ unsigned char *HostAlloc = (unsigned char *)malloc_host (1 , c);
63
+ auto e = q.memset (HostAlloc, 42 , 1 );
64
+ if (e.get_backend () != plt.get_backend ()) {
65
+ return_fail ();
35
66
}
36
67
}
37
68
}
You can’t perform that action at this time.
0 commit comments