21 inline namespace _V1 {
22 namespace ext::oneapi::experimental {
27 template <
int Dimensions>
29 template <
int Dimensions>
32 template <
typename RangeT>
41 typename = std::enable_if_t<
42 ext::oneapi::experimental::detail::is_range_or_nd_range_v<RangeT>>>
46 : MRange{Range}, MProperties{Properties} {}
50 PropertiesT MProperties;
52 const RangeT &getRange() const
noexcept {
return MRange; }
54 const PropertiesT &getProperties() const
noexcept {
return MProperties; }
56 template <
typename LCRangeT,
typename LCPropertiesT>
76 template <
typename CommandGroupFunc>
79 Q.
submit(std::forward<CommandGroupFunc>(CGF));
82 template <
typename CommandGroupFunc>
84 return Q.
submit(std::forward<CommandGroupFunc>(CGF));
87 template <
typename KernelName = sycl::detail::auto_name,
typename KernelType>
92 template <
typename KernelName = sycl::detail::auto_name,
typename KernelType>
94 submit(Q, [&](
handler &CGH) { single_task<KernelName>(CGH, KernelObj); });
97 template <
typename... ArgsT>
99 CGH.
set_args<ArgsT...>(std::forward<ArgsT>(Args)...);
103 template <
typename... ArgsT>
106 single_task(CGH, KernelObj, std::forward<ArgsT>(Args)...);
111 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
112 typename KernelType,
typename... ReductionsT>
114 const KernelType &KernelObj, ReductionsT &&...Reductions) {
115 CGH.
parallel_for<KernelName>(Range, std::forward<ReductionsT>(Reductions)...,
119 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
120 typename KernelType,
typename... ReductionsT>
122 ReductionsT &&...Reductions) {
124 parallel_for<KernelName>(CGH, Range, KernelObj,
125 std::forward<ReductionsT>(Reductions)...);
129 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
130 typename Properties,
typename KernelType,
typename... ReductionsT>
133 const KernelType &KernelObj, ReductionsT &&...Reductions) {
136 ConfigAccess(Config);
138 std::forward<ReductionsT>(Reductions)...,
142 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
143 typename Properties,
typename KernelType,
typename... ReductionsT>
145 const KernelType &KernelObj, ReductionsT &&...Reductions) {
147 parallel_for<KernelName>(CGH, Config, KernelObj,
148 std::forward<ReductionsT>(Reductions)...);
154 const kernel &KernelObj, ArgsT &&...Args) {
155 CGH.
set_args<ArgsT...>(std::forward<ArgsT>(Args)...);
163 parallel_for(CGH, Range, KernelObj, std::forward<ArgsT>(Args)...);
167 template <
int Dimensions,
typename Properties,
typename... ArgsT>
170 const kernel &KernelObj, ArgsT &&...Args) {
173 ConfigAccess(Config);
174 CGH.
set_args<ArgsT...>(std::forward<ArgsT>(Args)...);
178 template <
int Dimensions,
typename Properties,
typename... ArgsT>
180 const kernel &KernelObj, ArgsT &&...Args) {
182 parallel_for(CGH, Config, KernelObj, std::forward<ArgsT>(Args)...);
186 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
187 typename KernelType,
typename... ReductionsT>
189 const KernelType &KernelObj, ReductionsT &&...Reductions) {
190 CGH.
parallel_for<KernelName>(Range, std::forward<ReductionsT>(Reductions)...,
194 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
195 typename KernelType,
typename... ReductionsT>
197 ReductionsT &&...Reductions) {
199 nd_launch(CGH, Range, KernelObj, std::forward<ReductionsT>(Reductions)...);
203 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
204 typename Properties,
typename KernelType,
typename... ReductionsT>
207 const KernelType &KernelObj, ReductionsT &&...Reductions) {
211 ConfigAccess(Config);
213 std::forward<ReductionsT>(Reductions)...,
217 template <
typename KernelName = sycl::detail::auto_name,
int Dimensions,
218 typename Properties,
typename KernelType,
typename... ReductionsT>
220 const KernelType &KernelObj, ReductionsT &&...Reductions) {
222 nd_launch(CGH, Config, KernelObj, std::forward<ReductionsT>(Reductions)...);
228 const kernel &KernelObj, ArgsT &&...Args) {
229 CGH.
set_args<ArgsT...>(std::forward<ArgsT>(Args)...);
237 nd_launch(CGH, Range, KernelObj, std::forward<ArgsT>(Args)...);
241 template <
int Dimensions,
typename Properties,
typename... ArgsT>
244 const kernel &KernelObj, ArgsT &&...Args) {
247 ConfigAccess(Config);
248 CGH.
set_args<ArgsT...>(std::forward<ArgsT>(Args)...);
252 template <
int Dimensions,
typename Properties,
typename... ArgsT>
254 const kernel &KernelObj, ArgsT &&...Args) {
256 nd_launch(CGH, Config, KernelObj, std::forward<ArgsT>(Args)...);
260 inline void memcpy(
handler &CGH,
void *Dest,
const void *Src,
size_t NumBytes) {
261 CGH.
memcpy(Dest, Src, NumBytes);
264 inline void memcpy(
queue Q,
void *Dest,
const void *Src,
size_t NumBytes) {
268 template <
typename T>
270 CGH.
copy<T>(Src, Dest, Count);
273 template <
typename T>
void copy(
queue Q,
const T *Src, T *Dest,
size_t Count) {
274 submit(Q, [&](
handler &CGH) { copy<T>(CGH, Src, Dest, Count); });
278 CGH.
memset(Ptr, Value, NumBytes);
281 inline void memset(
queue Q,
void *Ptr,
int Value,
size_t NumBytes) {
285 template <
typename T>
287 CGH.
fill(Ptr, Pattern, Count);
290 template <
typename T>
292 submit(Q, [&](
handler &CGH) { fill<T>(CGH, Ptr, Pattern, Count); });
launch_config(RangeT Range, PropertiesT Properties={})
Command group handler class.
void single_task(_KERNELFUNCPARAM(KernelFunc))
Defines and invokes a SYCL kernel function as a function object type.
void parallel_for(range< 1 > NumWorkItems, _KERNELFUNCPARAM(KernelFunc))
void copy(accessor< T_Src, Dims, AccessMode, AccessTarget, IsPlaceholder > Src, std::shared_ptr< T_Dst > Dst)
Copies the content of memory object accessed by Src into the memory pointed by Dst.
void memcpy(void *Dest, const void *Src, size_t Count)
Copies data from one memory region to another, each is either a host pointer or a pointer within USM ...
void mem_advise(const void *Ptr, size_t Length, int Advice)
Provides additional information to the underlying runtime about how different allocations are used.
void fill(accessor< T, Dims, AccessMode, AccessTarget, IsPlaceholder, PropertyListT > Dst, const T &Pattern)
Fills memory pointed by accessor with the pattern given.
void prefetch(const void *Ptr, size_t Count)
Provides hints to the runtime library that data should be made available on a device earlier than Uni...
void memset(void *Dest, int Value, size_t Count)
Fills the memory pointed by a USM pointer with the value specified.
void ext_oneapi_barrier()
Prevents any commands submitted afterward to this queue from executing until all commands previously ...
void set_args(Ts &&...Args)
Sets arguments for OpenCL interoperability kernels.
Provides an abstraction of a SYCL kernel.
Defines the iteration domain of both the work-groups and the overall dispatch.
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
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...
Defines the iteration domain of either a single work-group in a parallel dispatch,...
constexpr bool is_range_or_nd_range_v
void mem_advise(handler &CGH, void *Ptr, size_t NumBytes, int Advice)
void copy(handler &CGH, const T *Src, T *Dest, size_t Count)
void prefetch(handler &CGH, void *Ptr, size_t NumBytes)
event submit_with_event(queue Q, CommandGroupFunc &&CGF)
void single_task(handler &CGH, const KernelType &KernelObj)
void memcpy(handler &CGH, void *Dest, const void *Src, size_t NumBytes)
void partial_barrier(handler &CGH, const std::vector< event > &Events)
void submit(queue Q, CommandGroupFunc &&CGF)
void nd_launch(handler &CGH, nd_range< Dimensions > Range, const KernelType &KernelObj, ReductionsT &&...Reductions)
void fill(sycl::handler &CGH, T *Ptr, const T &Pattern, size_t Count)
decltype(properties{}) empty_properties_t
void memset(handler &CGH, void *Ptr, int Value, size_t NumBytes)
void parallel_for(handler &CGH, range< Dimensions > Range, const KernelType &KernelObj, ReductionsT &&...Reductions)
void barrier(handler &CGH)
class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
_Abi const simd< _Tp, _Abi > & noexcept
const LCRangeT & getRange() const noexcept
LaunchConfigAccess(const launch_config< LCRangeT, LCPropertiesT > &LaunchConfig)
const launch_config< LCRangeT, LCPropertiesT > & MLaunchConfig
const LCPropertiesT & getProperties() const noexcept