Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sycl/source/device_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include <CL/sycl/detail/force_device.hpp>
#include <CL/sycl/device.hpp>
#include <CL/sycl/device_selector.hpp>
#include <CL/sycl/exception.hpp>
Expand Down Expand Up @@ -54,12 +55,13 @@ int default_selector::operator()(const device &dev) const {
}
}

// override always wins
if (dev.get_info<info::device::device_type>() == detail::get_forced_type())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when the device type is forced we only return devices of the forced type. Thus, this is redundant. Can someone who knows the device internals better confirm that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually do that apparently. We will limit the devices enumerated to that type plus the host device since the host device must always be available. In that case, the fact that the host device is available with higher priority means it gets selected.

return 1000;

if (dev.is_gpu())
return 500;

if (dev.is_accelerator())
return 400;

if (dev.is_cpu())
return 300;

Expand Down