Skip to content

Commit 8ef08d4

Browse files
authored
[SYCL] Add the nd_range validation to the handler-less path (#20328)
1 parent dabf72a commit 8ef08d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sycl/include/sycl/queue.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <sycl/detail/common.hpp> // for code_location
1919
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEP...
2020
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
21+
#include <sycl/detail/id_queries_fit_in_int.hpp> // for checkValueRange
2122
#include <sycl/detail/info_desc_helpers.hpp> // for is_queue_info_...
2223
#include <sycl/detail/kernel_desc.hpp> // for KernelInfo
2324
#include <sycl/detail/optional.hpp>
@@ -183,6 +184,10 @@ auto submit_kernel_direct(
183184
"must be either sycl::nd_item or be convertible from sycl::nd_item");
184185
using TransformedArgType = sycl::nd_item<Dims>;
185186

187+
#ifndef __SYCL_DEVICE_ONLY__
188+
detail::checkValueRange<Dims>(Range);
189+
#endif
190+
186191
detail::KernelWrapper<detail::WrapAs::parallel_for, NameT, KernelType,
187192
TransformedArgType, PropertiesT>::wrap(KernelFunc);
188193

sycl/test/include_deps/sycl_detail_core.hpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
// CHECK-NEXT: kernel_handler.hpp
101101
// CHECK-NEXT: nd_item.hpp
102102
// CHECK-NEXT: nd_range.hpp
103+
// CHECK-NEXT: detail/id_queries_fit_in_int.hpp
103104
// CHECK-NEXT: detail/optional.hpp
104105
// CHECK-NEXT: device.hpp
105106
// CHECK-NEXT: detail/string_view.hpp
@@ -134,7 +135,6 @@
134135
// CHECK-NEXT: CL/cl_ext.h
135136
// CHECK-NEXT: detail/get_device_kernel_info.hpp
136137
// CHECK-NEXT: detail/compile_time_kernel_info.hpp
137-
// CHECK-NEXT: detail/id_queries_fit_in_int.hpp
138138
// CHECK-NEXT: detail/kernel_launch_helper.hpp
139139
// CHECK-NEXT: ext/intel/experimental/fp_control_kernel_properties.hpp
140140
// CHECK-NEXT: ext/intel/experimental/kernel_execution_properties.hpp

0 commit comments

Comments
 (0)