@@ -617,45 +617,10 @@ class device_image_impl {
617617 MRTCBinInfo->MKernelNames .end ();
618618 }
619619
620- std::shared_ptr<kernel_impl> tryGetSourceBasedKernel (
621- std::string_view Name, const context &Context,
622- const std::shared_ptr<kernel_bundle_impl> &OwnerBundle,
623- const std::shared_ptr<device_image_impl> &Self) const {
624- if (!(getOriginMask () & ImageOriginKernelCompiler))
625- return nullptr ;
626-
627- assert (MRTCBinInfo);
628- std::string AdjustedName = adjustKernelName (Name);
629- if (MRTCBinInfo->MLanguage == syclex::source_language::sycl) {
630- auto &PM = ProgramManager::getInstance ();
631- for (const std::string &Prefix : MRTCBinInfo->MPrefixes ) {
632- auto KID = PM.tryGetSYCLKernelID (Prefix + AdjustedName);
633-
634- if (!KID || !has_kernel (*KID))
635- continue ;
636-
637- auto UrProgram = get_ur_program_ref ();
638- auto [UrKernel, CacheMutex, ArgMask] =
639- PM.getOrCreateKernel (Context, AdjustedName,
640- /* PropList=*/ {}, UrProgram);
641- return std::make_shared<kernel_impl>(UrKernel, *getSyclObjImpl (Context),
642- Self, OwnerBundle, ArgMask,
643- UrProgram, CacheMutex);
644- }
645- return nullptr ;
646- }
647-
648- ur_program_handle_t UrProgram = get_ur_program_ref ();
649- const AdapterPtr &Adapter = getSyclObjImpl (Context)->getAdapter ();
650- ur_kernel_handle_t UrKernel = nullptr ;
651- Adapter->call <UrApiKind::urKernelCreate>(UrProgram, AdjustedName.c_str (),
652- &UrKernel);
653- // Kernel created by urKernelCreate is implicitly retained.
654-
655- return std::make_shared<kernel_impl>(
656- UrKernel, *detail::getSyclObjImpl (Context), Self, OwnerBundle,
657- /* ArgMask=*/ nullptr , UrProgram, /* CacheMutex=*/ nullptr );
658- }
620+ std::shared_ptr<kernel_impl>
621+ tryGetSourceBasedKernel (std::string_view Name, const context &Context,
622+ const kernel_bundle_impl &OwnerBundle,
623+ const std::shared_ptr<device_image_impl> &Self) const ;
659624
660625 bool hasDeviceGlobalName (const std::string &Name) const noexcept {
661626 if (!MRTCBinInfo.has_value ())
0 commit comments