44
55namespace sycl {
66inline namespace _V1 {
7+
78#ifdef __DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS
89namespace khr {
910
@@ -75,23 +76,17 @@ void launch(handler &h, range<3> r, const kernel &k, ArgsT &&...args) {
7576
7677template <typename ... ArgsT>
7778void launch (queue q, range<1 > r, const kernel &k, ArgsT &&...args) {
78- submit (q, [&](handler &h) {
79- parallel_for (h, r, k, std::forward<ArgsT>(args)...);
80- });
79+ submit (q, [&](handler &h) { launch (h, r, k, std::forward<ArgsT>(args)...); });
8180}
8281
8382template <typename ... ArgsT>
8483void launch (queue q, range<2 > r, const kernel &k, ArgsT &&...args) {
85- submit (q, [&](handler &h) {
86- parallel_for (h, r, k, std::forward<ArgsT>(args)...);
87- });
84+ submit (q, [&](handler &h) { launch (h, r, k, std::forward<ArgsT>(args)...); });
8885}
8986
9087template <typename ... ArgsT>
9188void launch (queue q, range<3 > r, const kernel &k, ArgsT &&...args) {
92- submit (q, [&](handler &h) {
93- parallel_for (h, r, k, std::forward<ArgsT>(args)...);
94- });
89+ submit (q, [&](handler &h) { launch (h, r, k, std::forward<ArgsT>(args)...); });
9590}
9691
9792template <typename KernelType, typename ... Reductions>
@@ -303,7 +298,7 @@ inline void memcpy(handler &h, void *dest, const void *src, size_t numBytes) {
303298inline void memcpy (queue q, void *dest, const void *src, size_t numBytes,
304299 const sycl::detail::code_location &codeLoc =
305300 sycl::detail::code_location::current ()) {
306- q. submit ([&](handler &h) { memcpy (h , dest, src, numBytes); } , codeLoc);
301+ sycl::ext::oneapi::experimental:: memcpy (q , dest, src, numBytes, codeLoc);
307302}
308303
309304template <typename T>
@@ -335,7 +330,8 @@ void copy(queue q, const SrcT *src,
335330 accessor<DestT, DestDims, DestMode, target::device> dest,
336331 const sycl::detail::code_location &codeLoc =
337332 sycl::detail::code_location::current ()) {
338- q.submit (
333+ submit (
334+ q,
339335 [&](handler &h) {
340336 h.require (dest);
341337 copy (h, src, dest);
@@ -348,7 +344,8 @@ void copy(queue q, std::shared_ptr<SrcT> src,
348344 accessor<DestT, DestDims, DestMode, target::device> dest,
349345 const sycl::detail::code_location &codeLoc =
350346 sycl::detail::code_location::current ()) {
351- q.submit (
347+ submit (
348+ q,
352349 [&](handler &h) {
353350 h.require (dest);
354351 copy (h, src, dest);
@@ -373,7 +370,8 @@ void copy(queue q, accessor<SrcT, SrcDims, SrcMode, target::device> src,
373370 DestT *dest,
374371 const sycl::detail::code_location &codeLoc =
375372 sycl::detail::code_location::current ()) {
376- q.submit (
373+ submit (
374+ q,
377375 [&](handler &h) {
378376 h.require (src);
379377 copy (h, src, dest);
@@ -386,7 +384,8 @@ void copy(queue q, accessor<SrcT, SrcDims, SrcMode, target::device> src,
386384 std::shared_ptr<DestT> dest,
387385 const sycl::detail::code_location &codeLoc =
388386 sycl::detail::code_location::current ()) {
389- q.submit (
387+ submit (
388+ q,
390389 [&](handler &h) {
391390 h.require (src);
392391 copy (h, src, dest);
@@ -407,7 +406,8 @@ void copy(queue q, accessor<SrcT, SrcDims, SrcMode, target::device> src,
407406 accessor<DestT, DestDims, DestMode, target::device> dest,
408407 const sycl::detail::code_location &codeLoc =
409408 sycl::detail::code_location::current ()) {
410- q.submit (
409+ submit (
410+ q,
411411 [&](handler &h) {
412412 h.require (src);
413413 h.require (dest);
@@ -422,7 +422,7 @@ inline void memset(handler &h, void *ptr, int value, size_t numBytes) {
422422inline void memset (queue q, void *ptr, int value, size_t numBytes,
423423 const sycl::detail::code_location &codeLoc =
424424 sycl::detail::code_location::current ()) {
425- q. submit ([&](handler &h) { memset (h , ptr, value, numBytes); } , codeLoc);
425+ sycl::ext::oneapi::experimental:: memset (q , ptr, value, numBytes, codeLoc);
426426}
427427
428428template <typename T>
@@ -440,14 +440,15 @@ template <typename T>
440440void fill (queue q, T *ptr, const T &pattern, size_t count,
441441 const sycl::detail::code_location &codeLoc =
442442 sycl::detail::code_location::current ()) {
443- q. submit ([&](handler &h) { fill (h, ptr, pattern, count); }, codeLoc);
443+ submit (q, [&](handler &h) { fill (h, ptr, pattern, count); }, codeLoc);
444444}
445445
446446template <typename T, int Dims, access_mode Mode>
447447void fill (queue q, accessor<T, Dims, Mode, target::device> dest, const T &src,
448448 const sycl::detail::code_location &codeLoc =
449449 sycl::detail::code_location::current ()) {
450- q.submit (
450+ submit (
451+ q,
451452 [&](handler &h) {
452453 h.require (dest);
453454 fill (h, dest, src);
@@ -464,7 +465,8 @@ template <typename T, int Dims, access_mode Mode>
464465void update_host (queue q, accessor<T, Dims, Mode, target::device> acc,
465466 const sycl::detail::code_location &codeLoc =
466467 sycl::detail::code_location::current ()) {
467- q.submit (
468+ submit (
469+ q,
468470 [&](handler &h) {
469471 h.require (acc);
470472 update_host (h, acc);
@@ -478,7 +480,7 @@ inline void prefetch(handler &h, void *ptr, size_t numBytes) {
478480inline void prefetch (queue q, void *ptr, size_t numBytes,
479481 const sycl::detail::code_location &codeLoc =
480482 sycl::detail::code_location::current ()) {
481- q. submit ([&](handler &h) { prefetch (h, ptr, numBytes); }, codeLoc);
483+ submit (q, [&](handler &h) { prefetch (h, ptr, numBytes); }, codeLoc);
482484}
483485
484486inline void mem_advise (handler &h, void *ptr, size_t numBytes, int advice) {
@@ -488,7 +490,8 @@ inline void mem_advise(handler &h, void *ptr, size_t numBytes, int advice) {
488490inline void mem_advise (queue q, void *ptr, size_t numBytes, int advice,
489491 const sycl::detail::code_location &codeLoc =
490492 sycl::detail::code_location::current ()) {
491- q.submit ([&](handler &h) { mem_advise (h, ptr, numBytes, advice); }, codeLoc);
493+ sycl::ext::oneapi::experimental::mem_advise (q, ptr, numBytes, advice,
494+ codeLoc);
492495}
493496
494497inline void command_barrier (handler &h) { h.ext_oneapi_barrier (); }
0 commit comments