88
99#pragma once
1010
11- #include < utility> // for std::forward
11+ #include < utility>
1212
1313#include < sycl/detail/common.hpp>
1414#include < sycl/event.hpp>
@@ -72,14 +72,20 @@ template <typename LCRangeT, typename LCPropertiesT> struct LaunchConfigAccess {
7272 return MLaunchConfig.getProperties ();
7373 }
7474};
75+
76+ template <typename CommandGroupFunc>
77+ void submit_impl (queue &Q, CommandGroupFunc &&CGF,
78+ const sycl::detail::code_location &CodeLoc) {
79+ Q.submit_without_event (std::forward<CommandGroupFunc>(CGF), CodeLoc);
80+ }
7581} // namespace detail
7682
7783template <typename CommandGroupFunc>
7884void submit (queue Q, CommandGroupFunc &&CGF,
7985 const sycl::detail::code_location &CodeLoc =
8086 sycl::detail::code_location::current ()) {
81- // TODO: Use new submit without Events.
82- Q. submit ( std::forward<CommandGroupFunc>(CGF), CodeLoc);
87+ sycl::ext::oneapi::experimental::detail::submit_impl (
88+ Q, std::forward<CommandGroupFunc>(CGF), CodeLoc);
8389}
8490
8591template <typename CommandGroupFunc>
@@ -205,7 +211,8 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions,
205211void nd_launch (queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj,
206212 ReductionsT &&...Reductions) {
207213 submit (Q, [&](handler &CGH) {
208- nd_launch (CGH, Range, KernelObj, std::forward<ReductionsT>(Reductions)...);
214+ nd_launch<KernelName>(CGH, Range, KernelObj,
215+ std::forward<ReductionsT>(Reductions)...);
209216 });
210217}
211218
@@ -228,7 +235,8 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions,
228235void nd_launch (queue Q, launch_config<nd_range<Dimensions>, Properties> Config,
229236 const KernelType &KernelObj, ReductionsT &&...Reductions) {
230237 submit (Q, [&](handler &CGH) {
231- nd_launch (CGH, Config, KernelObj, std::forward<ReductionsT>(Reductions)...);
238+ nd_launch<KernelName>(CGH, Config, KernelObj,
239+ std::forward<ReductionsT>(Reductions)...);
232240 });
233241}
234242
@@ -270,11 +278,9 @@ inline void memcpy(handler &CGH, void *Dest, const void *Src, size_t NumBytes) {
270278 CGH.memcpy (Dest, Src, NumBytes);
271279}
272280
273- inline void memcpy (queue Q, void *Dest, const void *Src, size_t NumBytes,
274- const sycl::detail::code_location &CodeLoc =
275- sycl::detail::code_location::current ()) {
276- submit (Q, [&](handler &CGH) { memcpy (CGH, Dest, Src, NumBytes); }, CodeLoc);
277- }
281+ __SYCL_EXPORT void memcpy (queue Q, void *Dest, const void *Src, size_t NumBytes,
282+ const sycl::detail::code_location &CodeLoc =
283+ sycl::detail::code_location::current ());
278284
279285template <typename T>
280286void copy (handler &CGH, const T *Src, T *Dest, size_t Count) {
@@ -292,11 +298,9 @@ inline void memset(handler &CGH, void *Ptr, int Value, size_t NumBytes) {
292298 CGH.memset (Ptr, Value, NumBytes);
293299}
294300
295- inline void memset (queue Q, void *Ptr, int Value, size_t NumBytes,
296- const sycl::detail::code_location &CodeLoc =
297- sycl::detail::code_location::current ()) {
298- submit (Q, [&](handler &CGH) { memset (CGH, Ptr, Value, NumBytes); }, CodeLoc);
299- }
301+ __SYCL_EXPORT void memset (queue Q, void *Ptr, int Value, size_t NumBytes,
302+ const sycl::detail::code_location &CodeLoc =
303+ sycl::detail::code_location::current ());
300304
301305template <typename T>
302306void fill (sycl::handler &CGH, T *Ptr, const T &Pattern, size_t Count) {
@@ -324,13 +328,9 @@ inline void mem_advise(handler &CGH, void *Ptr, size_t NumBytes, int Advice) {
324328 CGH.mem_advise (Ptr, NumBytes, Advice);
325329}
326330
327- inline void mem_advise (queue Q, void *Ptr, size_t NumBytes, int Advice,
328- const sycl::detail::code_location &CodeLoc =
329- sycl::detail::code_location::current ()) {
330- submit (
331- Q, [&](handler &CGH) { mem_advise (CGH, Ptr, NumBytes, Advice); },
332- CodeLoc);
333- }
331+ __SYCL_EXPORT void mem_advise (queue Q, void *Ptr, size_t NumBytes, int Advice,
332+ const sycl::detail::code_location &CodeLoc =
333+ sycl::detail::code_location::current ());
334334
335335inline void barrier (handler &CGH) { CGH.ext_oneapi_barrier (); }
336336
0 commit comments