16 inline namespace _V1 {
17 template <
typename T,
typename>
19 size_t SrcPitch,
size_t Width,
21 throwIfGraphAssociated<
22 ext::oneapi::experimental::detail::UnsupportedGraphFeatures::
23 sycl_ext_oneapi_memcpy2d>();
24 throwIfActionIsCreated();
25 if (Width > DestPitch)
27 "Destination pitch must be greater than or equal "
28 "to the width specified in 'ext_oneapi_memcpy2d'");
31 "Source pitch must be greater than or equal "
32 "to the width specified in 'ext_oneapi_memcpy2d'");
35 context Ctx = detail::createSyclObjFromImpl<context>(getContextImplPtr());
48 if (SrcIsHost && DestIsHost) {
49 commonUSMCopy2DFallbackHostTask<T>(Src, SrcPitch, Dest, DestPitch, Width,
51 }
else if (SrcIsHost || DestIsHost || supportsUSMMemcpy2D()) {
52 ext_oneapi_memcpy2d_impl(Dest, DestPitch, Src, SrcPitch, Width, Height);
54 commonUSMCopy2DFallbackKernel<T>(Src, SrcPitch, Dest, DestPitch, Width,
61 size_t DestPitch,
size_t Width,
size_t Height) {
62 if (Width > DestPitch)
64 "Destination pitch must be greater than or equal "
65 "to the width specified in 'ext_oneapi_copy2d'");
68 "Source pitch must be greater than or equal "
69 "to the width specified in 'ext_oneapi_copy2d'");
72 context Ctx = detail::createSyclObjFromImpl<context>(getContextImplPtr());
85 if (SrcIsHost && DestIsHost) {
86 commonUSMCopy2DFallbackHostTask<T>(Src, SrcPitch, Dest, DestPitch, Width,
88 }
else if (SrcIsHost || DestIsHost || supportsUSMMemcpy2D()) {
89 ext_oneapi_memcpy2d_impl(Dest, DestPitch *
sizeof(T), Src,
90 SrcPitch *
sizeof(T), Width *
sizeof(T), Height);
92 commonUSMCopy2DFallbackKernel<T>(Src, SrcPitch, Dest, DestPitch, Width,
97 template <
typename T,
typename>
99 size_t Width,
size_t Height) {
100 throwIfActionIsCreated();
101 if (Width > DestPitch)
103 "Destination pitch must be greater than or equal "
104 "to the width specified in 'ext_oneapi_memset2d'");
105 T CharVal =
static_cast<T
>(Value);
107 context Ctx = detail::createSyclObjFromImpl<context>(getContextImplPtr());
113 commonUSMFill2DFallbackHostTask(Dest, DestPitch, CharVal, Width, Height);
114 else if (supportsUSMMemset2D())
115 ext_oneapi_memset2d_impl(Dest, DestPitch, Value, Width, Height);
117 commonUSMFill2DFallbackKernel(Dest, DestPitch, CharVal, Width, Height);
120 template <
typename T>
122 size_t Width,
size_t Height) {
123 throwIfActionIsCreated();
125 "Pattern must be device copyable");
126 if (Width > DestPitch)
128 "Destination pitch must be greater than or equal "
129 "to the width specified in 'ext_oneapi_fill2d'");
131 context Ctx = detail::createSyclObjFromImpl<context>(getContextImplPtr());
137 commonUSMFill2DFallbackHostTask(Dest, DestPitch, Pattern, Width, Height);
138 else if (supportsUSMFill2D())
139 ext_oneapi_fill2d_impl(Dest, DestPitch, &Pattern,
sizeof(T), Width, Height);
141 commonUSMFill2DFallbackKernel(Dest, DestPitch, Pattern, Width, Height);
144 template <
typename T,
typename>
146 size_t SrcPitch,
size_t Width,
size_t Height,
158 template <
typename T,
typename>
160 size_t SrcPitch,
size_t Width,
size_t Height,
161 const std::vector<event> &DepEvents,
172 template <
typename T>
174 size_t DestPitch,
size_t Width,
size_t Height,
183 template <
typename T>
185 size_t DestPitch,
size_t Width,
size_t Height,
196 template <
typename T>
198 size_t DestPitch,
size_t Width,
size_t Height,
199 const std::vector<event> &DepEvents,
209 template <
typename T,
typename>
211 size_t Width,
size_t Height,
220 template <
typename T,
typename>
222 size_t Width,
size_t Height,
event DepEvent,
232 template <
typename T,
typename>
234 size_t Width,
size_t Height,
235 const std::vector<event> &DepEvents,
245 template <
typename T>
247 size_t Width,
size_t Height,
256 template <
typename T>
258 size_t Width,
size_t Height,
event DepEvent,
268 template <
typename T>
270 size_t Width,
size_t Height,
271 const std::vector<event> &DepEvents,
The context class represents a SYCL context on which kernel functions may be executed.
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Command group handler class.
void depends_on(event Event)
Registers event dependencies on this command group.
void ext_oneapi_memset2d(void *Dest, size_t DestPitch, int Value, size_t Width, size_t Height)
Fills the memory pointed by a USM pointer with the value specified.
void ext_oneapi_fill2d(void *Dest, size_t DestPitch, const T &Pattern, size_t Width, size_t Height)
Fills the memory pointed by a USM pointer with the value specified.
void ext_oneapi_copy2d(const T *Src, size_t SrcPitch, T *Dest, size_t DestPitch, size_t Width, size_t Height)
Copies data from one 2D memory region to another, both pointed by USM pointers.
void ext_oneapi_memcpy2d(void *Dest, size_t DestPitch, const void *Src, size_t SrcPitch, size_t Width, size_t Height)
Copies data from one 2D memory region to another, both pointed by USM pointers.
event ext_oneapi_copy2d(const T *Src, size_t SrcPitch, T *Dest, size_t DestPitch, size_t Width, size_t Height, const detail::code_location &CodeLoc=detail::code_location::current())
Copies data from one 2D memory region to another, both pointed by USM pointers.
event ext_oneapi_memset2d(void *Dest, size_t DestPitch, int Value, size_t Width, size_t Height, const detail::code_location &CodeLoc=detail::code_location::current())
Fills the memory pointed by a USM pointer with the value specified.
event ext_oneapi_memcpy2d(void *Dest, size_t DestPitch, const void *Src, size_t SrcPitch, size_t Width, size_t Height, const detail::code_location &CodeLoc=detail::code_location::current())
Copies data from one 2D memory region to another, both pointed by USM pointers.
event ext_oneapi_fill2d(void *Dest, size_t DestPitch, const T &Pattern, size_t Width, size_t Height, const detail::code_location &CodeLoc=detail::code_location::current())
Fills the memory pointed by a USM pointer with the value specified.
std::enable_if_t< std::is_invocable_r_v< void, T, handler & >, event > submit(T CGF, const detail::code_location &CodeLoc=detail::code_location::current())
Submits a command group function object to the queue, in order to be scheduled for execution on the d...
usm::alloc get_pointer_type(const void *ptr, const context &ctxt)
Query the allocation type from a USM pointer.
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
is_device_copyable is a user specializable class template to indicate that a type T is device copyabl...