Skip to content

Commit 53ea8b9

Browse files
[SYCL] Use empty kernel bundle in make_kernel (#4866)
Calling make_kernel may inadverdently build other kernels than the one requested which may cause unexpected behavior. These changes make make_kernel use an empty kernel bundle in the default variant. Signed-off-by: Steffen Larsen <[email protected]>
1 parent 347b114 commit 53ea8b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sycl/include/CL/sycl/backend.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ kernel
217217
make_kernel(const typename backend_traits<Backend>::template input_type<kernel>
218218
&BackendObject,
219219
const context &TargetContext) {
220-
return detail::make_kernel(
221-
TargetContext, get_kernel_bundle<bundle_state::executable>(TargetContext),
222-
detail::pi::cast<pi_native_handle>(BackendObject), false, Backend);
220+
return detail::make_kernel(detail::pi::cast<pi_native_handle>(BackendObject),
221+
TargetContext, Backend);
223222
}
224223

225224
template <backend Backend, bundle_state State>

sycl/source/backend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ kernel make_kernel(const context &TargetContext,
247247
kernel make_kernel(pi_native_handle NativeHandle, const context &TargetContext,
248248
backend Backend) {
249249
return make_kernel(TargetContext,
250-
get_kernel_bundle<bundle_state::executable>(TargetContext),
250+
get_kernel_bundle<bundle_state::executable>(
251+
TargetContext, std::vector<kernel_id>{}),
251252
NativeHandle, false, Backend);
252253
}
253254

0 commit comments

Comments
 (0)