diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index 164ff270e237d..7d8c2888e50e1 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -255,8 +255,10 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase { ur_native_handle_t getNative() const; +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES __SYCL_DEPRECATED("Use getNative() member function") ur_native_handle_t getNativeImpl() const; +#endif std::shared_ptr impl; diff --git a/sycl/include/sycl/kernel_bundle.hpp b/sycl/include/sycl/kernel_bundle.hpp index 722544ed3697b..08d0428216300 100644 --- a/sycl/include/sycl/kernel_bundle.hpp +++ b/sycl/include/sycl/kernel_bundle.hpp @@ -123,9 +123,14 @@ class __SYCL_EXPORT device_image_plain { bool has_kernel(const kernel_id &KernelID, const device &Dev) const noexcept; +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES ur_native_handle_t getNative() const; - +#endif protected: +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + ur_native_handle_t getNative() const; +#endif + std::shared_ptr impl; template @@ -207,6 +212,9 @@ class device_image : public detail::device_image_plain, template friend T detail::createSyclObjFromImpl( std::add_lvalue_reference_t ImplObj); + + // To allow calling device_image_plain::getNative() + template friend class kernel_bundle; }; namespace detail { diff --git a/sycl/include/sycl/queue.hpp b/sycl/include/sycl/queue.hpp index 30373ac53ad47..d4f1ac086de0e 100644 --- a/sycl/include/sycl/queue.hpp +++ b/sycl/include/sycl/queue.hpp @@ -3549,7 +3549,12 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase { bool khr_empty() const; #endif +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES + // TODO: to be made private in the next ABI-breaking window + __SYCL_DEPRECATED( + "This is a non-standard method, use sycl::get_native instead") ur_native_handle_t getNative(int32_t &NativeHandleDesc) const; +#endif std::optional ext_oneapi_get_last_event() const { return static_cast>(ext_oneapi_get_last_event_impl()); @@ -3558,6 +3563,10 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase { void ext_oneapi_set_external_event(const event &external_event); private: +#ifdef __INTEL_PREVIEW_BREAKING_CHANGES + ur_native_handle_t getNative(int32_t &NativeHandleDesc) const; +#endif + std::shared_ptr impl; queue(std::shared_ptr impl) : impl(impl) {} @@ -3575,6 +3584,10 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase { friend auto get_native(const SyclObjectT &Obj) -> backend_return_t; + template + friend auto get_native(const queue &Obj) + -> backend_return_t; + #ifndef __INTEL_PREVIEW_BREAKING_CHANGES #if __SYCL_USE_FALLBACK_ASSERT friend event detail::submitAssertCapture(const queue &, event &, diff --git a/sycl/source/kernel.cpp b/sycl/source/kernel.cpp index 7f4c16982f22e..bb742332bc96d 100644 --- a/sycl/source/kernel.cpp +++ b/sycl/source/kernel.cpp @@ -253,9 +253,9 @@ kernel::kernel(std::shared_ptr Impl) : impl(Impl) {} ur_native_handle_t kernel::getNative() const { return impl->getNative(); } +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES ur_native_handle_t kernel::getNativeImpl() const { return impl->getNative(); } -#ifndef __INTEL_PREVIEW_BREAKING_CHANGES // The following query was deprecated since it doesn't include a way to specify // the invdividual dimensions of the work group. All of the contents of this // #ifndef block should be removed during the next ABI breaking window.