@@ -31,7 +31,6 @@ static bool isDeviceOfPreferredSyclBe(const device &Device) {
31
31
device device_selector::select_device () const {
32
32
vector_class<device> devices = device::get_devices ();
33
33
// SYCL specification uses -1 to reject a device from selection
34
- const int REJECT_DEVICE_SCORE = -1 ;
35
34
int score = REJECT_DEVICE_SCORE;
36
35
const device *res = nullptr ;
37
36
@@ -91,7 +90,7 @@ device device_selector::select_device() const {
91
90
92
91
int default_selector::operator ()(const device &dev) const {
93
92
94
- int Score = - 1 ;
93
+ int Score = REJECT_DEVICE_SCORE ;
95
94
96
95
// Give preference to device of SYCL BE.
97
96
if (isDeviceOfPreferredSyclBe (dev))
@@ -114,7 +113,8 @@ int default_selector::operator()(const device &dev) const {
114
113
}
115
114
116
115
int gpu_selector::operator ()(const device &dev) const {
117
- int Score = -1 ;
116
+ int Score = REJECT_DEVICE_SCORE;
117
+
118
118
if (dev.is_gpu ()) {
119
119
Score = 1000 ;
120
120
// Give preference to device of SYCL BE.
@@ -125,7 +125,7 @@ int gpu_selector::operator()(const device &dev) const {
125
125
}
126
126
127
127
int cpu_selector::operator ()(const device &dev) const {
128
- int Score = - 1 ;
128
+ int Score = REJECT_DEVICE_SCORE ;
129
129
if (dev.is_cpu ()) {
130
130
Score = 1000 ;
131
131
// Give preference to device of SYCL BE.
@@ -136,7 +136,7 @@ int cpu_selector::operator()(const device &dev) const {
136
136
}
137
137
138
138
int accelerator_selector::operator ()(const device &dev) const {
139
- int Score = - 1 ;
139
+ int Score = REJECT_DEVICE_SCORE ;
140
140
if (dev.is_accelerator ()) {
141
141
Score = 1000 ;
142
142
// Give preference to device of SYCL BE.
@@ -147,7 +147,7 @@ int accelerator_selector::operator()(const device &dev) const {
147
147
}
148
148
149
149
int host_selector::operator ()(const device &dev) const {
150
- int Score = - 1 ;
150
+ int Score = REJECT_DEVICE_SCORE ;
151
151
if (dev.is_host ()) {
152
152
Score = 1000 ;
153
153
// Give preference to device of SYCL BE.
0 commit comments