Skip to content

Commit 37be97f

Browse files
asserts
1 parent f303575 commit 37be97f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sycl/source/handler.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,20 @@ event handler::finalize() {
560560
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
561561
toKernelNameStrT(MKernelName));
562562
}
563+
564+
detail::DeviceKernelInfo &Info = *impl->MDeviceKernelInfoPtr;
565+
(void)Info;
566+
567+
// Make sure that information set by old binaries gets properly copied to
568+
// the `DeviceKernelInfo` so that the rest of the code base could use it as
569+
// the single source of all the data:
570+
assert(MKernelName == static_cast<std::string_view>(Info.Name));
571+
assert(static_cast<unsigned>(impl->MKernelNumArgs) == Info.NumParams);
572+
assert(impl->MKernelParamDescGetter == Info.ParamDescGetter ||
573+
impl->MKernelParamDescGetter == nullptr);
574+
assert(impl->MKernelIsESIMD == Info.IsESIMD);
575+
assert(impl->MKernelHasSpecialCaptures == Info.HasSpecialCaptures);
576+
563577
// If there were uses of set_specialization_constant build the kernel_bundle
564578
detail::kernel_bundle_impl *KernelBundleImpPtr =
565579
getOrInsertHandlerKernelBundlePtr(/*Insert=*/false);

0 commit comments

Comments
 (0)