From 20fa2a9bfa7db65d49865c7692032db69539432a Mon Sep 17 00:00:00 2001 From: James Brodman Date: Fri, 6 Mar 2020 10:04:04 -0500 Subject: [PATCH 1/4] Remove accels from default selector as people aren't likely to want to accidentally stumble upon a fpga. Signed-off-by: James Brodman --- sycl/source/device_selector.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index 1b6c2d7bef7ad..8eddab0c1698b 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -57,9 +57,6 @@ int default_selector::operator()(const device &dev) const { if (dev.is_gpu()) return 500; - if (dev.is_accelerator()) - return 400; - if (dev.is_cpu()) return 300; From 040edc2f52272ac3b512e6475efbd51d1797565d Mon Sep 17 00:00:00 2001 From: James Brodman Date: Fri, 6 Mar 2020 11:28:54 -0500 Subject: [PATCH 2/4] Change to preferring host to accel Signed-off-by: James Brodman --- sycl/source/device_selector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index 8eddab0c1698b..d43e0f9a248cb 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -63,6 +63,9 @@ int default_selector::operator()(const device &dev) const { if (dev.is_host()) return 100; + if (dev.is_accelerator()) + return 50; + return -1; } From 4df0958489582406966a5dbd50d1e24cd15c8eab Mon Sep 17 00:00:00 2001 From: James Brodman Date: Mon, 9 Mar 2020 14:00:38 -0400 Subject: [PATCH 3/4] Make the override always win Signed-off-by: James Brodman --- sycl/source/device_selector.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index d43e0f9a248cb..207f183e47fbd 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include #include #include #include @@ -54,6 +55,10 @@ int default_selector::operator()(const device &dev) const { } } + // override always wins + if (dev.get_info() == detail::get_forced_type()) + return 1000; + if (dev.is_gpu()) return 500; From e8f6a0f3ed1f78fcdd7643420b5f3f2ca1008777 Mon Sep 17 00:00:00 2001 From: James Brodman Date: Fri, 3 Apr 2020 10:45:50 -0400 Subject: [PATCH 4/4] Remove redundant code and rebase Signed-off-by: James Brodman --- sycl/source/device_selector.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sycl/source/device_selector.cpp b/sycl/source/device_selector.cpp index 207f183e47fbd..9ca9e3d14a37a 100644 --- a/sycl/source/device_selector.cpp +++ b/sycl/source/device_selector.cpp @@ -68,9 +68,6 @@ int default_selector::operator()(const device &dev) const { if (dev.is_host()) return 100; - if (dev.is_accelerator()) - return 50; - return -1; }