28 #include <type_traits>
33 inline namespace _V1 {
36 class AccessorBaseHost;
38 class DispatchHostTask;
62 template <
backend Backend =
backend::opencl, typename DataT,
int Dims,
64 typename PropertyListT = ext::oneapi::accessor_property_list<>>
70 Target == access::target::constant_buffer,
71 "The method is available only for target::device accessors");
72 #ifndef __SYCL_DEVICE_ONLY__
75 "Incorrect backend argument was passed");
77 return getMemImpl<Backend, DataT, Dims>(
98 #ifndef __SYCL_DEVICE_ONLY__
101 "Incorrect backend argument was passed");
123 template <backend Backend = backend::opencl>
125 #ifndef __SYCL_DEVICE_ONLY__
131 "Incorrect backend argument was passed");
132 int32_t NativeHandleDesc;
134 getNativeQueue(NativeHandleDesc));
146 template <backend Backend = backend::opencl>
148 #ifndef __SYCL_DEVICE_ONLY__
154 "Incorrect backend argument was passed");
168 template <backend Backend = backend::opencl>
170 #ifndef __SYCL_DEVICE_ONLY__
176 "Incorrect backend argument was passed");
188 using ReqToMem = std::pair<detail::AccessorImplHost *, ur_mem_handle_t>;
191 const std::shared_ptr<detail::queue_impl> &Queue,
192 const std::shared_ptr<detail::device_impl> &Device,
193 const std::shared_ptr<detail::context_impl> &Context)
194 : MQueue(Queue), MDevice(Device), MContext(Context),
195 MMemObjs(
std::move(MemObjs)) {}
197 template <backend Backend,
typename DataT,
int Dims>
200 std::vector<ur_native_handle_t> NativeHandles{getNativeMem(Req)};
205 template <backend Backend,
int Dims>
206 backend_return_t<Backend, image<Dims>>
207 getMemImpl(detail::AccessorImplHost *Req)
const {
208 using image_return_t = backend_return_t<Backend, image<Dims>>;
209 return reinterpret_cast<image_return_t
>(getNativeMem(Req));
212 __SYCL_EXPORT ur_native_handle_t
213 getNativeMem(detail::AccessorImplHost *Req)
const;
214 __SYCL_EXPORT ur_native_handle_t
215 getNativeQueue(int32_t &NativeHandleDesc)
const;
216 __SYCL_EXPORT ur_native_handle_t getNativeDevice()
const;
217 __SYCL_EXPORT ur_native_handle_t getNativeContext()
const;
219 std::shared_ptr<detail::queue_impl> MQueue;
220 std::shared_ptr<detail::device_impl> MDevice;
221 std::shared_ptr<detail::context_impl> MContext;
223 std::vector<ReqToMem> MMemObjs;
The file contains implementations of accessor class.
Defines a shared array that can be used by kernels in queues.
The exec CG command enqueues execution of kernel or explicit memory operation.
Defines a shared image data.
backend_return_t< Backend, queue > get_native_queue() const
Returns an underlying native backend object associated with teh queue that the host task was submitte...
std::enable_if_t< Target !=access::target::image, backend_return_t< Backend, buffer< DataT, Dims > > > get_native_mem(const accessor< DataT, Dims, Mode, Target, IsPlh, PropertyListT > &Acc) const
Receives a SYCL accessor that has been defined as a requirement for the command group,...
backend get_backend() const noexcept
Returns a backend associated with the queue associated with this interop_handle.
backend_return_t< Backend, context > get_native_context() const
Returns the SYCL application interoperability native backend object associated with the context assoc...
backend_return_t< Backend, image< Dims > > get_native_mem(const detail::image_accessor< DataT, Dims, Mode, Target, IsPlh > &Acc) const
Receives a SYCL accessor that has been defined as a requirement for the command group,...
backend_return_t< Backend, device > get_native_device() const
Returns the SYCL application interoperability native backend object associated with the device associ...
decltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
_Abi const simd< _Tp, _Abi > & noexcept
static ReturnType GetNativeObjs(const std::vector< ur_native_handle_t > &Handle)