diff --git a/SYCL/Reduction/reduction_nd_N_queue_shortcut.cpp b/SYCL/Reduction/reduction_nd_N_queue_shortcut.cpp index 782aed15e3..2e1c87a10d 100644 --- a/SYCL/Reduction/reduction_nd_N_queue_shortcut.cpp +++ b/SYCL/Reduction/reduction_nd_N_queue_shortcut.cpp @@ -65,11 +65,9 @@ int test(queue &Q, BOpT1 BOp1, BOpT2 BOp2, const nd_range &Range) { }) .wait(); } else if constexpr (TC == TestCase::Dependency) { - auto E = Q.single_task([=]() { - std::fill(Arr1, Arr1 + NElems, 1); - std::fill(Arr2, Arr2 + NElems, 2); - }); - Q.parallel_for(Range, E, R1, R2, + auto E1 = Q.fill(Arr1, 1, NElems); + auto E2 = Q.fill(Arr2, 2, NElems, E1); + Q.parallel_for(Range, E2, R1, R2, [=](nd_item It, auto &Sum1, auto &Sum2) { size_t LinId = It.get_global_linear_id(); Sum1.combine(static_cast(LinId) + Arr1[LinId]); @@ -77,8 +75,8 @@ int test(queue &Q, BOpT1 BOp1, BOpT2 BOp2, const nd_range &Range) { }) .wait(); } else { - auto E1 = Q.single_task([=]() { std::fill(Arr1, Arr1 + NElems, 1); }); - auto E2 = Q.single_task([=]() { std::fill(Arr2, Arr2 + NElems, 2); }); + auto E1 = Q.fill(Arr1, 1, NElems); + auto E2 = Q.fill(Arr2, 2, NElems); std::vector EVec{E1, E2}; Q.parallel_for(Range, EVec, R1, R2, [=](nd_item It, auto &Sum1, auto &Sum2) { diff --git a/SYCL/Reduction/reduction_nd_queue_shortcut.cpp b/SYCL/Reduction/reduction_nd_queue_shortcut.cpp index f3817a4054..c449445c65 100644 --- a/SYCL/Reduction/reduction_nd_queue_shortcut.cpp +++ b/SYCL/Reduction/reduction_nd_queue_shortcut.cpp @@ -45,13 +45,13 @@ int test(queue &Q, BinaryOperation BOp, const nd_range &Range) { Sum.combine(static_cast(LinId) + Arr[LinId]); }).wait(); } else if constexpr (TC == TestCase::Dependency) { - auto E = Q.single_task([=]() { std::fill(Arr, Arr + NElems, 1); }); + auto E = Q.fill(Arr, 1, NElems); Q.parallel_for(Range, E, Redu, [=](nd_item It, auto &Sum) { size_t LinId = It.get_global_linear_id(); Sum.combine(static_cast(LinId) + Arr[LinId]); }).wait(); } else { - auto E = Q.single_task([=]() { std::fill(Arr, Arr + NElems, 1); }); + auto E = Q.fill(Arr, 1, NElems); std::vector EVec{E}; Q.parallel_for(Range, EVec, Redu, [=](nd_item It, auto &Sum) { size_t LinId = It.get_global_linear_id(); diff --git a/SYCL/Reduction/reduction_range_queue_shortcut.cpp b/SYCL/Reduction/reduction_range_queue_shortcut.cpp index 43079f14fd..bd371d7ac1 100644 --- a/SYCL/Reduction/reduction_range_queue_shortcut.cpp +++ b/SYCL/Reduction/reduction_range_queue_shortcut.cpp @@ -53,13 +53,13 @@ int test(queue &Q, BinaryOperation BOp, const range &Range) { Sum.combine(static_cast(LinId) + Arr[LinId]); }).wait(); } else if constexpr (TC == TestCase::Dependency) { - auto E = Q.single_task([=]() { std::fill(Arr, Arr + NElems, 1); }); + auto E = Q.fill(Arr, 1, NElems); Q.parallel_for(Range, E, Redu, [=](id Id, auto &Sum) { size_t LinId = linearizeId(Id, Range); Sum.combine(static_cast(LinId) + Arr[LinId]); }).wait(); } else { - auto E = Q.single_task([=]() { std::fill(Arr, Arr + NElems, 1); }); + auto E = Q.fill(Arr, 1, NElems); std::vector EVec{E}; Q.parallel_for(Range, EVec, Redu, [=](id Id, auto &Sum) { size_t LinId = linearizeId(Id, Range);