Skip to content

Commit

Permalink
[SYCL] Change priority of devices in default_selector (#1264)
Browse files Browse the repository at this point in the history
Make the override always win

Signed-off-by: James Brodman <james.brodman@intel.com>
  • Loading branch information
jbrodman authored Apr 3, 2020
1 parent ee21d66 commit b217bc5
Showing 1 changed file with 5 additions and 3 deletions.
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())
return 1000;

if (dev.is_gpu())
return 500;

if (dev.is_accelerator())
return 400;

if (dev.is_cpu())
return 300;

Expand Down

0 comments on commit b217bc5

Please sign in to comment.