Skip to content

Commit 7500e3d

Browse files
Add assertion to max wg size (#2580)
--------- Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
1 parent c4d223e commit 7500e3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ struct __parallel_copy_if_single_group_functor<__internal::__optional_kernel_nam
513513
operator()(sycl::queue& __q, _InRng&& __in_rng, _OutRng&& __out_rng, _Size __n, _Size __n_out, _UnaryOp __unary_op,
514514
_Assign __assign, std::size_t __max_wg_size)
515515
{
516+
assert(__max_wg_size <= std::numeric_limits<std::uint16_t>::max());
516517
// This type is used as a workaround for when an internal tuple is assigned to std::tuple, such as
517518
// with zip_iterator
518519
using __tuple_type = typename oneapi::dpl::__internal::__get_tuple_type<
@@ -922,7 +923,7 @@ __parallel_copy_if(oneapi::dpl::__internal::__device_backend_tag, _ExecutionPoli
922923
std::array<_Size, 2> __ret = {__n_out, __n};
923924
sycl::queue __q_local = __exec.queue();
924925

925-
constexpr std::uint16_t __max_elem_per_item = 2;
926+
constexpr std::size_t __max_elem_per_item = 2;
926927
std::size_t __max_wg_size = oneapi::dpl::__internal::__max_work_group_size(__q_local);
927928

928929
// Note: earlier the data size for the single group kernel was capped by 2048

0 commit comments

Comments
 (0)