@@ -175,37 +175,33 @@ int main() {
175
175
targetDevIndex = GetPreferredDeviceIndex (devices, info::device_type::all);
176
176
assert (targetDevIndex >= 0 &&
177
177
" Failed to find target device for default selector." );
178
- default_selector ds;
179
- device d = ds.select_device ();
180
- std::cout << " default_selector selected " ;
178
+ device d (default_selector_v);
179
+ std::cout << " default_selector_v selected " ;
181
180
printDeviceType (d);
182
181
assert (devices[targetDevIndex] == d &&
183
182
" The selected device is not the target device specified." );
184
183
}
185
184
targetDevIndex = GetPreferredDeviceIndex (devices, info::device_type::gpu);
186
185
if (targetDevIndex >= 0 ) {
187
- gpu_selector gs;
188
- device d = gs.select_device ();
189
- std::cout << " gpu_selector selected " ;
186
+ device d (gpu_selector_v);
187
+ std::cout << " gpu_selector_v selected " ;
190
188
printDeviceType (d);
191
189
assert (devices[targetDevIndex] == d &&
192
190
" The selected device is not the target device specified." );
193
191
}
194
192
targetDevIndex = GetPreferredDeviceIndex (devices, info::device_type::cpu);
195
193
if (targetDevIndex >= 0 ) {
196
- cpu_selector cs;
197
- device d = cs.select_device ();
198
- std::cout << " cpu_selector selected " ;
194
+ device d (cpu_selector_v);
195
+ std::cout << " cpu_selector_v selected " ;
199
196
printDeviceType (d);
200
197
assert (devices[targetDevIndex] == d &&
201
198
" The selected device is not the target device specified." );
202
199
}
203
200
targetDevIndex =
204
201
GetPreferredDeviceIndex (devices, info::device_type::accelerator);
205
202
if (targetDevIndex >= 0 ) {
206
- accelerator_selector as;
207
- device d = as.select_device ();
208
- std::cout << " accelerator_selector selected " ;
203
+ device d (accelerator_selector_v);
204
+ std::cout << " accelerator_selector_v selected " ;
209
205
printDeviceType (d);
210
206
assert (devices[targetDevIndex] == d &&
211
207
" The selected device is not the target device specified." );
0 commit comments