Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 2bf2d04

Browse files
committed
Attempt kernel bundle creation only when kernels are present
1 parent fad1650 commit 2bf2d04

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

SYCL/KernelAndProgram/built-in-kernel-ids.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ int main() {
1313

1414
auto ids = dev.get_info<sycl::info::device::built_in_kernel_ids>();
1515

16+
if (ids.empty()) // exception is only thrown when there are built-in kernels
17+
return 0;
18+
1619
sycl::errc val = sycl::errc::success;
1720
std::string msg;
1821
try {
@@ -22,13 +25,11 @@ int main() {
2225
msg = e.what();
2326
}
2427

25-
if (!ids.empty()) { // exception only thrown when there built-in kernels
26-
if (val != sycl::errc::kernel_argument)
27-
return 1;
28-
if (msg !=
29-
"Attempting to use a built-in kernel. They are not fully supported")
30-
return 1;
31-
}
28+
if (val != sycl::errc::kernel_argument)
29+
return 1;
30+
if (msg !=
31+
"Attempting to use a built-in kernel. They are not fully supported")
32+
return 1;
3233

3334
return 0;
3435
}

0 commit comments

Comments
 (0)