Skip to content

Commit 7da4a02

Browse files
committed
fix
1 parent 151404a commit 7da4a02

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sycl/test-e2e/Basic/info.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,12 @@ int main() {
323323
print_info<info::device::name, std::string>(dev, "Name");
324324
print_info<info::device::vendor, std::string>(dev, "Vendor");
325325
print_info<info::device::driver_version, std::string>(dev, "Driver version");
326-
print_info<info::device::profile, std::string>(dev, "Profile");
326+
try {
327+
print_info<info::device::profile, std::string>(dev, "Profile");
328+
} catch (const sycl::exception &e) {
329+
std::cout << "Expected exception has been caught: " << e.what()
330+
<< std::endl;
331+
}
327332
print_info<info::device::version, std::string>(dev, "Version");
328333
print_info<info::device::backend_version, std::string>(dev,
329334
"Backend version");
@@ -333,9 +338,12 @@ int main() {
333338
"Extensions");
334339
print_info<info::device::printf_buffer_size, size_t>(dev,
335340
"Printf buffer size");
336-
if (Backend == backend::opencl) {
341+
try {
337342
print_info<info::device::preferred_interop_user_sync, bool>(
338343
dev, "Preferred interop user sync");
344+
} catch (const sycl::exception &e) {
345+
std::cout << "Expected exception has been caught: " << e.what()
346+
<< std::endl;
339347
}
340348
try {
341349
print_info<info::device::parent_device, device>(dev, "Parent device");
@@ -362,9 +370,7 @@ int main() {
362370

363371
std::cout << separator << "Platform information\n" << separator;
364372
platform plt(dev.get_platform());
365-
if (Backend == sycl::backend::opencl) {
366-
print_info<info::platform::profile, std::string>(plt, "Profile");
367-
}
373+
print_info<info::platform::profile, std::string>(plt, "Profile");
368374
print_info<info::platform::version, std::string>(plt, "Version");
369375
print_info<info::platform::name, std::string>(plt, "Name");
370376
print_info<info::platform::vendor, std::string>(plt, "Vendor");

0 commit comments

Comments
 (0)