Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ class __SYCL_EXPORT handler {
bool IsKernelCreatedFromSource, bool IsESIMD);
#endif

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
/// \return a string containing name of SYCL kernel.
detail::ABINeutralKernelNameStrT getKernelName();

Expand All @@ -543,6 +544,7 @@ class __SYCL_EXPORT handler {
detail::ABINeutralKernelNameStrT KernelName = getKernelName();
return KernelName == LambdaName;
}
#endif

/// Saves the location of user's code passed in \p CodeLoc for future usage in
/// finalize() method.
Expand Down Expand Up @@ -1897,6 +1899,10 @@ class __SYCL_EXPORT handler {
Kernel);
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
// Implementation for something that had to be removed long ago but now stuck
// until next major release...

/// Defines and invokes a SYCL kernel function.
///
/// \param Kernel is a SYCL kernel that is executed on a SYCL device
Expand Down Expand Up @@ -1931,6 +1937,7 @@ class __SYCL_EXPORT handler {
detail::CheckDeviceCopyable<KernelType>();
#endif
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
/// Defines and invokes a SYCL kernel function for the specified range.
Expand Down
8 changes: 5 additions & 3 deletions sycl/source/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ void handler::extractArgsAndReqs() {
if (impl->MKernelData.getDeviceKernelInfoPtr() == nullptr) {
impl->MKernelData.setDeviceKernelInfoPtr(
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
toKernelNameStrT(getKernelName())));
detail::toKernelNameStrT(MKernel->getName())));
}
#endif
assert(impl->MKernelData.getDeviceKernelInfoPtr() != nullptr);
Expand All @@ -1109,7 +1109,7 @@ void handler::extractArgsAndReqsFromLambda(
if (impl->MKernelData.getDeviceKernelInfoPtr() == nullptr) {
impl->MKernelData.setDeviceKernelInfoPtr(
&detail::ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
toKernelNameStrT(getKernelName())));
detail::toKernelNameStrT(MKernel->getName())));
}
impl->MKernelData.setKernelInfo(LambdaPtr, NumKernelParams, ParamDescGetter,
IsESIMD, true);
Expand Down Expand Up @@ -1158,12 +1158,14 @@ void handler::extractArgsAndReqsFromLambda(
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
// Calling methods of kernel_impl requires knowledge of class layout.
// As this is impossible in header, there's a function that calls necessary
// method inside the library and returns the result.
detail::ABINeutralKernelNameStrT handler::getKernelName() {
return MKernel->getName();
}
#endif

void handler::verifyUsedKernelBundleInternal(detail::string_view KernelName) {
detail::kernel_bundle_impl *UsedKernelBundleImplPtr =
Expand Down Expand Up @@ -2239,7 +2241,7 @@ sycl::detail::CGType handler::getType() const { return impl->MCGType; }

void handler::setDeviceKernelInfo(kernel &&Kernel) {
MKernel = detail::getSyclObjImpl(std::move(Kernel));
MKernelName = getKernelName();
MKernelName = MKernel->getName();
setDeviceKernelInfoPtr(&MKernel->getDeviceKernelInfo());
setType(detail::CGType::Kernel);

Expand Down
Loading