diff --git a/sycl/include/CL/sycl/interop_handle.hpp b/sycl/include/CL/sycl/interop_handle.hpp index a09d8cee7ccaa..eb6e7fb81cc77 100644 --- a/sycl/include/CL/sycl/interop_handle.hpp +++ b/sycl/include/CL/sycl/interop_handle.hpp @@ -36,6 +36,12 @@ class context; class interop_handle { public: + interop_handle() = delete; + + /// Returns a backend associated with the queue associated with this + /// interop_handle. + __SYCL_EXPORT backend get_backend() const noexcept; + /// Receives a SYCL accessor that has been defined as a requirement for the /// command group, and returns the underlying OpenCL memory object that is /// used by the SYCL runtime. If the accessor passed as parameter is not part @@ -131,7 +137,6 @@ class interop_handle { friend class detail::DispatchHostTask; using ReqToMem = std::pair; - // TODO set c-tor private interop_handle(std::vector MemObjs, const std::shared_ptr &Queue, const std::shared_ptr &Device, @@ -139,7 +144,6 @@ class interop_handle { : MQueue(Queue), MDevice(Device), MContext(Context), MMemObjs(std::move(MemObjs)) {} -private: template auto getMemImpl(detail::Requirement *Req) const -> diff --git a/sycl/source/interop_handle.cpp b/sycl/source/interop_handle.cpp index 2f52601e7abdb..fff99ab730d6d 100644 --- a/sycl/source/interop_handle.cpp +++ b/sycl/source/interop_handle.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,10 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { +backend interop_handle::get_backend() const noexcept { + return detail::getImplBackend(MQueue); +} + pi_native_handle interop_handle::getNativeMem(detail::Requirement *Req) const { auto Iter = std::find_if(std::begin(MMemObjs), std::end(MMemObjs), [=](ReqToMem Elem) { return (Elem.first == Req); }); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 45cad7e458fdc..f1f83610993b1 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3908,6 +3908,7 @@ _ZNK2cl4sycl13host_selectorclERKNS0_6deviceE _ZNK2cl4sycl14exception_list3endEv _ZNK2cl4sycl14exception_list4sizeEv _ZNK2cl4sycl14exception_list5beginEv +_ZNK2cl4sycl14interop_handle11get_backendEv _ZNK2cl4sycl14interop_handle12getNativeMemEPNS0_6detail16AccessorImplHostE _ZNK2cl4sycl14interop_handle14getNativeQueueEv _ZNK2cl4sycl14interop_handle15getNativeDeviceEv