Skip to content

Commit fd977d2

Browse files
committed
Formatting change and test simplification.
Signed-off-by: James Brodman <[email protected]>
1 parent 6a4346f commit fd977d2

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

sycl/source/device.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ vector_class<device> device::get_devices(info::device_type deviceType) {
4646
vector_class<device> host_device(
4747
plt.get_devices(info::device_type::host));
4848
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 {
5351
vector_class<device> found_devices(plt.get_devices(deviceType));
5452
if (!found_devices.empty())
5553
devices.insert(devices.end(), found_devices.begin(),

sycl/test/basic_tests/host_always_works.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
using namespace cl::sycl;
1818

19-
class foo;
2019
int main() {
2120
device(host_selector{});
2221

sycl/test/basic_tests/host_platform_avail.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,17 @@
1616

1717
using namespace cl::sycl;
1818

19-
class foo;
2019
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;
2422

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;
3427
}
35-
// Fail if we didn't find a host platform
36-
if (!found_host)
37-
return 1;
3828
}
3929

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);
4232
}

0 commit comments

Comments
 (0)