@@ -432,10 +432,9 @@ class __SYCL_EXPORT queue {
432432 // / \param NumWorkItems is a range that specifies the work space of the kernel
433433 // / \param KernelFunc is the Kernel functor or lambda
434434 // / \param CodeLoc contains the code location of user code
435- template <typename KernelName = detail::auto_name, typename KernelType,
436- int Dims>
435+ template <typename KernelName = detail::auto_name, typename KernelType>
437436 event parallel_for (
438- range<Dims > NumWorkItems, KernelType KernelFunc
437+ range<1 > NumWorkItems, KernelType KernelFunc
439438#ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
440439 ,
441440 const detail::code_location &CodeLoc = detail::code_location::current()
@@ -444,12 +443,47 @@ class __SYCL_EXPORT queue {
444443#ifdef DISABLE_SYCL_INSTRUMENTATION_METADATA
445444 const detail::code_location &CodeLoc = {};
446445#endif
447- return submit (
448- [&](handler &CGH) {
449- CGH.template parallel_for <KernelName, KernelType>(NumWorkItems,
450- KernelFunc);
451- },
452- CodeLoc);
446+ return parallel_for_impl<KernelName>(NumWorkItems, KernelFunc, CodeLoc);
447+ }
448+
449+ // / parallel_for version with a kernel represented as a lambda + range that
450+ // / specifies global size only.
451+ // /
452+ // / \param NumWorkItems is a range that specifies the work space of the kernel
453+ // / \param KernelFunc is the Kernel functor or lambda
454+ // / \param CodeLoc contains the code location of user code
455+ template <typename KernelName = detail::auto_name, typename KernelType>
456+ event parallel_for (
457+ range<2 > NumWorkItems, KernelType KernelFunc
458+ #ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
459+ ,
460+ const detail::code_location &CodeLoc = detail::code_location::current()
461+ #endif
462+ ) {
463+ #ifdef DISABLE_SYCL_INSTRUMENTATION_METADATA
464+ const detail::code_location &CodeLoc = {};
465+ #endif
466+ return parallel_for_impl<KernelName>(NumWorkItems, KernelFunc, CodeLoc);
467+ }
468+
469+ // / parallel_for version with a kernel represented as a lambda + range that
470+ // / specifies global size only.
471+ // /
472+ // / \param NumWorkItems is a range that specifies the work space of the kernel
473+ // / \param KernelFunc is the Kernel functor or lambda
474+ // / \param CodeLoc contains the code location of user code
475+ template <typename KernelName = detail::auto_name, typename KernelType>
476+ event parallel_for (
477+ range<3 > NumWorkItems, KernelType KernelFunc
478+ #ifndef DISABLE_SYCL_INSTRUMENTATION_METADATA
479+ ,
480+ const detail::code_location &CodeLoc = detail::code_location::current()
481+ #endif
482+ ) {
483+ #ifdef DISABLE_SYCL_INSTRUMENTATION_METADATA
484+ const detail::code_location &CodeLoc = {};
485+ #endif
486+ return parallel_for_impl<KernelName>(NumWorkItems, KernelFunc, CodeLoc);
453487 }
454488
455489 // / parallel_for version with a kernel represented as a lambda + range that
@@ -716,6 +750,25 @@ class __SYCL_EXPORT queue {
716750 // / A template-free version of submit.
717751 event submit_impl (function_class<void (handler &)> CGH, queue secondQueue,
718752 const detail::code_location &CodeLoc);
753+
754+ // / parallel_for_impl with a kernel represented as a lambda + range that
755+ // / specifies global size only.
756+ // /
757+ // / \param NumWorkItems is a range that specifies the work space of the kernel
758+ // / \param KernelFunc is the Kernel functor or lambda
759+ // / \param CodeLoc contains the code location of user code
760+ template <typename KernelName = detail::auto_name, typename KernelType,
761+ int Dims>
762+ event parallel_for_impl (
763+ range<Dims> NumWorkItems, KernelType KernelFunc,
764+ const detail::code_location &CodeLoc = detail::code_location::current()) {
765+ return submit (
766+ [&](handler &CGH) {
767+ CGH.template parallel_for <KernelName, KernelType>(NumWorkItems,
768+ KernelFunc);
769+ },
770+ CodeLoc);
771+ }
719772};
720773
721774} // namespace sycl
0 commit comments