diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index 180766f874661..2f3da68d98f17 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -1696,8 +1696,13 @@ class __SYCL_EXPORT handler { void setStateSpecConstSet(); bool isStateExplicitKernelBundle() const; +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + __SYCL_DLL_LOCAL std::shared_ptr & + getOrInsertHandlerKernelBundle(bool Insert) const; +#else std::shared_ptr getOrInsertHandlerKernelBundle(bool Insert) const; +#endif void setHandlerKernelBundle(kernel Kernel); diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index 59cbcb5384b8e..c6df0c328aa16 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -373,11 +373,19 @@ bool handler::isStateExplicitKernelBundle() const { return impl->isStateExplicitKernelBundle(); } +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES +// Returns a reference to shared_ptr to the kernel_bundle. +// If there is no kernel_bundle created: +// returns newly created kernel_bundle if Insert is true +// returns shared_ptr(nullptr) if Insert is false +std::shared_ptr & +#else // Returns a shared_ptr to the kernel_bundle. // If there is no kernel_bundle created: // returns newly created kernel_bundle if Insert is true // returns shared_ptr(nullptr) if Insert is false std::shared_ptr +#endif handler::getOrInsertHandlerKernelBundle(bool Insert) const { if (!impl->MKernelBundle && Insert) { auto Ctx = @@ -472,7 +480,11 @@ event handler::finalize() { if (type == detail::CGType::Kernel) { // If there were uses of set_specialization_constant build the kernel_bundle +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + std::shared_ptr &KernelBundleImpPtr = +#else std::shared_ptr KernelBundleImpPtr = +#endif getOrInsertHandlerKernelBundle(/*Insert=*/false); if (KernelBundleImpPtr) { // Make sure implicit non-interop kernel bundles have the kernel @@ -1346,7 +1358,11 @@ detail::ABINeutralKernelNameStrT handler::getKernelName() { } void handler::verifyUsedKernelBundleInternal(detail::string_view KernelName) { +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + auto &UsedKernelBundleImplPtr = +#else auto UsedKernelBundleImplPtr = +#endif getOrInsertHandlerKernelBundle(/*Insert=*/false); if (!UsedKernelBundleImplPtr) return;