@@ -38,8 +38,6 @@ auto joint_inclusive_scan_helper(Group group, T* v_begin, T* v_end,
3838 return sycl::joint_inclusive_scan (group, v_begin, v_end, r_i_begin, op,
3939 I (init));
4040 }
41- assert ((std::is_same_v<I, U> &&
42- " Without init value I and U should be the same type." ));
4341 return (U*)sycl::joint_inclusive_scan (group, v_begin, v_end, (I*)r_i_begin,
4442 op);
4543}
@@ -51,8 +49,6 @@ auto joint_exclusive_scan_helper(Group group, T* v_begin, T* v_end,
5149 return sycl::joint_exclusive_scan (group, v_begin, v_end, r_e_begin, I (init),
5250 op);
5351 }
54- assert ((std::is_same_v<I, U> &&
55- " Without init value I and U should be the same type." ));
5652 return (U*)sycl::joint_exclusive_scan (group, v_begin, v_end, (I*)r_e_begin,
5753 op);
5854}
@@ -149,6 +145,9 @@ void check_scan(sycl::queue& queue, size_t size,
149145 sycl::buffer<bool , 1 > end_sycl = host_data.create_end_buffer ();
150146 sycl::buffer<bool , 1 > ret_type_sycl = host_data.create_ret_type_buffer ();
151147
148+ assert ((with_init || std::is_same_v<I, U>) &&
149+ " Without init value I and U must be the same type." );
150+
152151 queue
153152 .submit ([&](sycl::handler& cgh) {
154153 sycl::accessor<T, 1 > ref_input_acc (ref_input_sycl, cgh);
@@ -315,8 +314,6 @@ auto inclusive_scan_over_group_helper(Group group, U x, OpT op,
315314 if (with_init) {
316315 return sycl::inclusive_scan_over_group (group, x, op, T (init));
317316 }
318- assert ((std::is_same_v<T, U> &&
319- " Without init value T and U should be the same type." ));
320317 return sycl::inclusive_scan_over_group (group, T (x), op);
321318}
322319
@@ -326,8 +323,6 @@ auto exclusive_scan_over_group_helper(Group group, U x, OpT op,
326323 if (with_init) {
327324 return sycl::exclusive_scan_over_group (group, x, T (init), op);
328325 }
329- assert ((std::is_same_v<T, U> &&
330- " Without init value T and U should be the same type." ));
331326 return sycl::exclusive_scan_over_group (group, T (x), op);
332327}
333328
@@ -457,6 +452,9 @@ void check_scan_over_group(sycl::queue& queue, sycl::range<D> range, OpT op,
457452 auto local_id_sycl = host_data.create_local_id_buffer ();
458453 auto sub_group_id_sycl = host_data.create_sub_group_id_buffer ();
459454
455+ assert ((with_init || std::is_same_v<T, U>) &&
456+ " Without init value T and U must be the same type." );
457+
460458 queue
461459 .submit ([&](sycl::handler& cgh) {
462460 sycl::accessor<U, 1 , sycl::access_mode::read> ref_input_acc (
0 commit comments