File tree 2 files changed +16
-3
lines changed 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,11 @@ template <>
359
359
struct get_device_info_impl <std::vector<info::execution_capability>,
360
360
info::device::execution_capabilities> {
361
361
static std::vector<info::execution_capability> get (const DeviceImplPtr &Dev) {
362
+ if (Dev->getBackend () != backend::opencl)
363
+ throw exception (make_error_code (errc::invalid),
364
+ " info::device::execution_capabilities is available for "
365
+ " backend::opencl only" );
366
+
362
367
ur_device_exec_capability_flag_t result;
363
368
Dev->getAdapter ()->call <UrApiKind::urDeviceGetInfo>(
364
369
Dev->getHandleRef (),
Original file line number Diff line number Diff line change @@ -313,9 +313,17 @@ int main() {
313
313
dev, " Is compiler available" );
314
314
print_info<info::device::is_linker_available, bool >(dev,
315
315
" Is linker available" );
316
- print_info<info::device::execution_capabilities,
317
- std::vector<info::execution_capability>>(dev,
318
- " Execution capabilities" );
316
+ try {
317
+ print_info<info::device::execution_capabilities,
318
+ std::vector<info::execution_capability>>(
319
+ dev, " Execution capabilities" );
320
+ assert (backend == sycl::backend::opencl &&
321
+ " An exception is expected for non OpenCL backend" );
322
+ } catch (const sycl::exception &e) {
323
+ assert (e.code () == sycl::errc::invalid &&
324
+ backend != sycl::backend::opencl && " Unexpected exception" );
325
+ }
326
+
319
327
print_info<info::device::queue_profiling, bool >(dev, " Queue profiling" );
320
328
print_info<info::device::built_in_kernels, std::vector<std::string>>(
321
329
dev, " Built in kernels" );
You can’t perform that action at this time.
0 commit comments