@@ -24,6 +24,9 @@ __SYCL_INLINE_NAMESPACE(cl) {
2424namespace sycl {
2525// Forward declarations
2626class device_selector ;
27+ template <backend BackendName, class SyclObjectT >
28+ auto get_native (const SyclObjectT &Obj)
29+ -> backend_return_t<BackendName, SyclObjectT>;
2730namespace detail {
2831class device_impl ;
2932auto getDeviceComparisonLambda ();
@@ -184,19 +187,6 @@ class __SYCL_EXPORT device {
184187 // / \return the backend associated with this device.
185188 backend get_backend () const noexcept ;
186189
187- // / Gets the native handle of the SYCL device.
188- // /
189- // / \return a native handle, the type of which defined by the backend.
190- template <backend Backend>
191- __SYCL_DEPRECATED (" Use SYCL 2020 sycl::get_native free function" )
192- backend_return_t <Backend, device> get_native () const {
193- // In CUDA CUdevice isn't an opaque pointer, unlike a lot of the others,
194- // but instead a 32-bit int (on all relevant systems). Different
195- // backends use the same function for this purpose so static_cast is
196- // needed in some cases but not others, so a C-style cast was chosen.
197- return (backend_return_t <Backend, device>)getNative ();
198- }
199-
200190 // / Indicates if the SYCL device has the given feature.
201191 // /
202192 // / \param Aspect is one of the values in Table 4.20 of the SYCL 2020
@@ -223,6 +213,10 @@ class __SYCL_EXPORT device {
223213 friend T detail::createSyclObjFromImpl (decltype (T::impl) ImplObj);
224214
225215 friend auto detail::getDeviceComparisonLambda ();
216+
217+ template <backend BackendName, class SyclObjectT >
218+ friend auto get_native (const SyclObjectT &Obj)
219+ -> backend_return_t<BackendName, SyclObjectT>;
226220};
227221
228222} // namespace sycl
0 commit comments