File tree Expand file tree Collapse file tree 3 files changed +10
-23
lines changed Expand file tree Collapse file tree 3 files changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,8 @@ vector_class<device> device::get_devices(info::device_type deviceType) {
46
46
vector_class<device> host_device (
47
47
plt.get_devices (info::device_type::host));
48
48
if (!host_device.empty ())
49
- devices.insert (devices.end (), host_device.begin (),
50
- host_device.end ());
51
- }
52
- else {
49
+ devices.insert (devices.end (), host_device.begin (), host_device.end ());
50
+ } else {
53
51
vector_class<device> found_devices (plt.get_devices (deviceType));
54
52
if (!found_devices.empty ())
55
53
devices.insert (devices.end (), found_devices.begin (),
Original file line number Diff line number Diff line change 16
16
17
17
using namespace cl ::sycl;
18
18
19
- class foo ;
20
19
int main () {
21
20
device (host_selector{});
22
21
Original file line number Diff line number Diff line change 16
16
17
17
using namespace cl ::sycl;
18
18
19
- class foo ;
20
19
int main () {
21
- queue q;
22
- auto dev = q.get_device ();
23
- auto dev_platform = dev.get_platform ();
20
+ auto plats = platform::get_platforms ();
21
+ bool found_host = false ;
24
22
25
- if (!dev_platform.is_host ()) {
26
- auto plats = platform::get_platforms ();
27
- bool found_host = false ;
28
-
29
- // Look for a host platform
30
- for (const auto &plat : plats) {
31
- if (plat.is_host ()) {
32
- found_host = true ;
33
- }
23
+ // Look for a host platform
24
+ for (const auto &plat : plats) {
25
+ if (plat.is_host ()) {
26
+ found_host = true ;
34
27
}
35
- // Fail if we didn't find a host platform
36
- if (!found_host)
37
- return 1 ;
38
28
}
39
29
40
- // Found a host platform, all is well
41
- return 0 ;
30
+ // Fail if we didn't find a host platform
31
+ return (!found_host) ;
42
32
}
You can’t perform that action at this time.
0 commit comments