Skip to content

Commit 814d0ba

Browse files
Test asserts
1 parent b6a63c9 commit 814d0ba

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ class __SYCL_EXPORT handler {
494494
template <class Kernel> void setDeviceKernelInfo(void *KernelFuncPtr) {
495495
constexpr auto Info = detail::CompileTimeKernelInfo<Kernel>;
496496
MKernelName = Info.Name;
497-
// TODO support ESIMD in no-integration-header case too.
498497
setKernelInfo(KernelFuncPtr, Info.NumParams, Info.ParamDescGetter,
499498
Info.IsESIMD, Info.HasSpecialCaptures);
500499
setDeviceKernelInfoPtr(&detail::getDeviceKernelInfo<Kernel>());

sycl/source/handler.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,19 @@ event handler::finalize() {
553553
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
554554
toKernelNameStrT(MKernelName));
555555
}
556+
557+
DeviceKernelInfo &Info = *impl->MDeviceKernelInfoPtr;
558+
(void)Info;
559+
560+
// Make sure that information set by old binaries gets properly copied to
561+
// the `DeviceKernelInfo` so that the rest of the code base could use it as
562+
// the single source of all the data:
563+
assert(MKernelName == Info.Name);
564+
assert(impl->MKernelNumArgs == Info.NumParams);
565+
assert(impl->MKernelParamDescGetter == Info.ParamDescGetter);
566+
assert(impl->MKernelIsESIMD = Info.IsESIMD);
567+
assert(impl->MKernelHasSpecialCaptures = Info.HasSpecialCaptures);
568+
556569
// If there were uses of set_specialization_constant build the kernel_bundle
557570
detail::kernel_bundle_impl *KernelBundleImpPtr =
558571
getOrInsertHandlerKernelBundlePtr(/*Insert=*/false);

0 commit comments

Comments
 (0)