Skip to content

Commit 552f448

Browse files
committed
Address review comments
1 parent eed0591 commit 552f448

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ event submit_with_event_impl(const queue &Q, PropertiesT Props,
109109
const sycl::detail::code_location &CodeLoc) {
110110
return Q.submit_with_event(Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
111111
}
112-
113112
} // namespace detail
114113

115114
template <typename CommandGroupFunc, typename PropertiesT>
@@ -261,18 +260,18 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions,
261260
void nd_launch(queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj,
262261
ReductionsT &&...Reductions) {
263262
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
263+
// TODO The handler-less path does not support reductions yet.
264264
if constexpr (sizeof...(ReductionsT) == 0) {
265265
detail::submit_kernel_direct<KernelName>(std::move(Q), empty_properties_t{},
266266
Range, KernelObj);
267-
} else {
267+
} else
268268
#endif
269+
{
269270
submit(std::move(Q), [&](handler &CGH) {
270271
nd_launch<KernelName>(CGH, Range, KernelObj,
271272
std::forward<ReductionsT>(Reductions)...);
272273
});
273-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
274274
}
275-
#endif
276275
}
277276

278277
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
@@ -294,22 +293,22 @@ template <typename KernelName = sycl::detail::auto_name, int Dimensions,
294293
void nd_launch(queue Q, launch_config<nd_range<Dimensions>, Properties> Config,
295294
const KernelType &KernelObj, ReductionsT &&...Reductions) {
296295
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
296+
// TODO The handler-less path does not support reductions yet.
297297
if constexpr (sizeof...(ReductionsT) == 0) {
298298
ext::oneapi::experimental::detail::LaunchConfigAccess<nd_range<Dimensions>,
299299
Properties>
300300
ConfigAccess(Config);
301301
detail::submit_kernel_direct<KernelName>(
302302
std::move(Q), ConfigAccess.getProperties(), ConfigAccess.getRange(),
303303
KernelObj);
304-
} else {
304+
} else
305305
#endif
306+
{
306307
submit(std::move(Q), [&](handler &CGH) {
307308
nd_launch<KernelName>(CGH, Config, KernelObj,
308309
std::forward<ReductionsT>(Reductions)...);
309310
});
310-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
311311
}
312-
#endif
313312
}
314313

315314
template <int Dimensions, typename... ArgsT>

sycl/include/sycl/khr/free_function_commands.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace sycl {
66
inline namespace _V1 {
77

8-
#ifdef __DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS
8+
//#ifdef __DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS
99
namespace khr {
1010

1111
template <typename CommandGroupFunc>
@@ -538,6 +538,6 @@ inline void event_barrier(const queue &q, const std::vector<event> &events,
538538
}
539539

540540
} // namespace khr
541-
#endif
541+
//#endif
542542
} // namespace _V1
543543
} // namespace sycl

sycl/include/sycl/queue.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ auto get_native(const SyclObjectT &Obj)
6464

6565
template <int Dims>
6666
event __SYCL_EXPORT submit_kernel_direct_with_event_impl(
67-
const queue &Queue, nd_range<Dims> Range,
67+
const queue &Queue, const nd_range<Dims> &Range,
6868
std::shared_ptr<detail::HostKernelBase> &HostKernel,
6969
detail::DeviceKernelInfo *DeviceKernelInfo,
7070
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
7171

7272
template <int Dims>
7373
void __SYCL_EXPORT submit_kernel_direct_without_event_impl(
74-
const queue &Queue, nd_range<Dims> Range,
74+
const queue &Queue, const nd_range<Dims> &Range,
7575
std::shared_ptr<detail::HostKernelBase> &HostKernel,
7676
detail::DeviceKernelInfo *DeviceKernelInfo,
7777
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
@@ -159,7 +159,7 @@ class __SYCL_EXPORT SubmissionInfo {
159159
template <typename KernelName = detail::auto_name, bool EventNeeded = false,
160160
typename PropertiesT, typename KernelType, int Dims>
161161
auto submit_kernel_direct(
162-
const queue &Queue, PropertiesT Props, nd_range<Dims> Range,
162+
const queue &Queue, PropertiesT Props, const nd_range<Dims> &Range,
163163
const KernelType &KernelFunc,
164164
const detail::code_location &CodeLoc = detail::code_location::current()) {
165165
// TODO Properties not supported yet
@@ -3271,20 +3271,20 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
32713271
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
32723272
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
32733273
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
3274+
// TODO The handler-less path does not support reductions yet.
32743275
if constexpr (sizeof...(RestT) == 1) {
32753276
return detail::submit_kernel_direct<KernelName, true>(
32763277
*this, ext::oneapi::experimental::empty_properties_t{}, Range,
32773278
Rest...);
3278-
} else {
3279+
} else
32793280
#endif
3281+
{
32803282
return submit(
32813283
[&](handler &CGH) {
32823284
CGH.template parallel_for<KernelName>(Range, Rest...);
32833285
},
32843286
TlsCodeLocCapture.query());
3285-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
32863287
}
3287-
#endif
32883288
}
32893289

32903290
/// parallel_for version with a kernel represented as a lambda + nd_range that

sycl/source/detail/queue_impl.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
361361

362362
template <int Dims>
363363
event submit_kernel_direct_with_event(
364-
nd_range<Dims> Range, std::shared_ptr<detail::HostKernelBase> &HostKernel,
364+
const nd_range<Dims> &Range,
365+
std::shared_ptr<detail::HostKernelBase> &HostKernel,
365366
detail::DeviceKernelInfo *DeviceKernelInfo,
366367
const detail::code_location &CodeLoc, bool IsTopCodeLoc) {
367368
detail::EventImplPtr EventImpl =
@@ -372,7 +373,8 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
372373

373374
template <int Dims>
374375
void submit_kernel_direct_without_event(
375-
nd_range<Dims> Range, std::shared_ptr<detail::HostKernelBase> &HostKernel,
376+
const nd_range<Dims> &Range,
377+
std::shared_ptr<detail::HostKernelBase> &HostKernel,
376378
detail::DeviceKernelInfo *DeviceKernelInfo,
377379
const detail::code_location &CodeLoc, bool IsTopCodeLoc) {
378380
submit_kernel_direct_impl(NDRDescT{Range}, HostKernel, DeviceKernelInfo,

sycl/source/queue.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ const property_list &queue::getPropList() const { return impl->getPropList(); }
482482

483483
template <int Dims>
484484
event submit_kernel_direct_with_event_impl(
485-
const queue &Queue, nd_range<Dims> Range,
485+
const queue &Queue, const nd_range<Dims> &Range,
486486
std::shared_ptr<detail::HostKernelBase> &HostKernel,
487487
detail::DeviceKernelInfo *DeviceKernelInfo,
488488
const detail::code_location &CodeLoc, bool IsTopCodeLoc) {
@@ -491,26 +491,26 @@ event submit_kernel_direct_with_event_impl(
491491
}
492492

493493
template event submit_kernel_direct_with_event_impl<1>(
494-
const queue &Queue, nd_range<1> Range,
494+
const queue &Queue, const nd_range<1> &Range,
495495
std::shared_ptr<detail::HostKernelBase> &HostKernel,
496496
detail::DeviceKernelInfo *DeviceKernelInfo,
497497
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
498498

499499
template event submit_kernel_direct_with_event_impl<2>(
500-
const queue &Queue, nd_range<2> Range,
500+
const queue &Queue, const nd_range<2> &Range,
501501
std::shared_ptr<detail::HostKernelBase> &HostKernel,
502502
detail::DeviceKernelInfo *DeviceKernelInfo,
503503
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
504504

505505
template event submit_kernel_direct_with_event_impl<3>(
506-
const queue &Queue, nd_range<3> Range,
506+
const queue &Queue, const nd_range<3> &Range,
507507
std::shared_ptr<detail::HostKernelBase> &HostKernel,
508508
detail::DeviceKernelInfo *DeviceKernelInfo,
509509
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
510510

511511
template <int Dims>
512512
void submit_kernel_direct_without_event_impl(
513-
const queue &Queue, nd_range<Dims> Range,
513+
const queue &Queue, const nd_range<Dims> &Range,
514514
std::shared_ptr<detail::HostKernelBase> &HostKernel,
515515
detail::DeviceKernelInfo *DeviceKernelInfo,
516516
const detail::code_location &CodeLoc, bool IsTopCodeLoc) {
@@ -519,19 +519,19 @@ void submit_kernel_direct_without_event_impl(
519519
}
520520

521521
template void submit_kernel_direct_without_event_impl<1>(
522-
const queue &Queue, nd_range<1> Range,
522+
const queue &Queue, const nd_range<1> &Range,
523523
std::shared_ptr<detail::HostKernelBase> &HostKernel,
524524
detail::DeviceKernelInfo *DeviceKernelInfo,
525525
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
526526

527527
template void submit_kernel_direct_without_event_impl<2>(
528-
const queue &Queue, nd_range<2> Range,
528+
const queue &Queue, const nd_range<2> &Range,
529529
std::shared_ptr<detail::HostKernelBase> &HostKernel,
530530
detail::DeviceKernelInfo *DeviceKernelInfo,
531531
const detail::code_location &CodeLoc, bool IsTopCodeLoc);
532532

533533
template void submit_kernel_direct_without_event_impl<3>(
534-
const queue &Queue, nd_range<3> Range,
534+
const queue &Queue, const nd_range<3> &Range,
535535
std::shared_ptr<detail::HostKernelBase> &HostKernel,
536536
detail::DeviceKernelInfo *DeviceKernelInfo,
537537
const detail::code_location &CodeLoc, bool IsTopCodeLoc);

0 commit comments

Comments
 (0)