@@ -140,12 +140,19 @@ template <typename... Ts> ReduTupleT<Ts...> makeReduTupleT(Ts... Elements) {
140140 return sycl::detail::make_tuple (Elements...);
141141}
142142
143+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
144+ __SYCL_EXPORT size_t reduGetMaxWGSize (const std::shared_ptr<queue_impl> &Queue,
145+ size_t LocalMemBytesPerWorkItem);
146+ __SYCL_EXPORT size_t reduGetPreferredWGSize (
147+ const std::shared_ptr<queue_impl> &Queue, size_t LocalMemBytesPerWorkItem);
148+ #else
143149__SYCL_EXPORT size_t reduGetMaxWGSize (std::shared_ptr<queue_impl> Queue,
144150 size_t LocalMemBytesPerWorkItem);
145- __SYCL_EXPORT size_t reduComputeWGSize (size_t NWorkItems, size_t MaxWGSize,
146- size_t &NWorkGroups);
147151__SYCL_EXPORT size_t reduGetPreferredWGSize (std::shared_ptr<queue_impl> &Queue,
148152 size_t LocalMemBytesPerWorkItem);
153+ #endif
154+ __SYCL_EXPORT size_t reduComputeWGSize (size_t NWorkItems, size_t MaxWGSize,
155+ size_t &NWorkGroups);
149156
150157template <typename T, class BinaryOperation , bool IsOptional>
151158class ReducerElement ;
@@ -1071,7 +1078,12 @@ class reduction_impl_algo {
10711078 std::shared_ptr<int > Counter (malloc_device<int >(1 , q), Deleter);
10721079 CGH.addReduction (Counter);
10731080
1074- addCounterInit (CGH, CGH.MQueue , Counter);
1081+ #ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1082+ std::shared_ptr<detail::queue_impl> Queue (CGH.MQueue );
1083+ #else
1084+ std::shared_ptr<detail::queue_impl> &Queue = CGH.MQueue ;
1085+ #endif
1086+ addCounterInit (CGH, Queue, Counter);
10751087
10761088 return Counter.get ();
10771089 }
@@ -1229,7 +1241,8 @@ template <>
12291241struct NDRangeReduction <reduction::strategy::local_atomic_and_atomic_cross_wg> {
12301242 template <typename KernelName, int Dims, typename PropertiesT,
12311243 typename KernelType, typename Reduction>
1232- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1244+ static void run (handler &CGH,
1245+ const std::shared_ptr<detail::queue_impl> &Queue,
12331246 nd_range<Dims> NDRange, PropertiesT &Properties,
12341247 Reduction &Redu, KernelType &KernelFunc) {
12351248 static_assert (Reduction::has_identity,
@@ -1280,7 +1293,8 @@ struct NDRangeReduction<
12801293 reduction::strategy::group_reduce_and_last_wg_detection> {
12811294 template <typename KernelName, int Dims, typename PropertiesT,
12821295 typename KernelType, typename Reduction>
1283- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1296+ static void run (handler &CGH,
1297+ const std::shared_ptr<detail::queue_impl> &Queue,
12841298 nd_range<Dims> NDRange, PropertiesT &Properties,
12851299 Reduction &Redu, KernelType &KernelFunc) {
12861300 static_assert (Reduction::has_identity,
@@ -1479,7 +1493,8 @@ void doTreeReductionOnTuple(size_t WorkSize, size_t LID,
14791493template <> struct NDRangeReduction <reduction::strategy::range_basic> {
14801494 template <typename KernelName, int Dims, typename PropertiesT,
14811495 typename KernelType, typename Reduction>
1482- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1496+ static void run (handler &CGH,
1497+ const std::shared_ptr<detail::queue_impl> &Queue,
14831498 nd_range<Dims> NDRange, PropertiesT &Properties,
14841499 Reduction &Redu, KernelType &KernelFunc) {
14851500 using reducer_type = typename Reduction::reducer_type;
@@ -1590,7 +1605,8 @@ template <>
15901605struct NDRangeReduction <reduction::strategy::group_reduce_and_atomic_cross_wg> {
15911606 template <typename KernelName, int Dims, typename PropertiesT,
15921607 typename KernelType, typename Reduction>
1593- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1608+ static void run (handler &CGH,
1609+ const std::shared_ptr<detail::queue_impl> &Queue,
15941610 nd_range<Dims> NDRange, PropertiesT &Properties,
15951611 Reduction &Redu, KernelType &KernelFunc) {
15961612 static_assert (Reduction::has_identity,
@@ -1626,7 +1642,8 @@ struct NDRangeReduction<
16261642 reduction::strategy::local_mem_tree_and_atomic_cross_wg> {
16271643 template <typename KernelName, int Dims, typename PropertiesT,
16281644 typename KernelType, typename Reduction>
1629- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1645+ static void run (handler &CGH,
1646+ const std::shared_ptr<detail::queue_impl> &Queue,
16301647 nd_range<Dims> NDRange, PropertiesT &Properties,
16311648 Reduction &Redu, KernelType &KernelFunc) {
16321649 using reducer_type = typename Reduction::reducer_type;
@@ -1687,7 +1704,8 @@ struct NDRangeReduction<
16871704 reduction::strategy::group_reduce_and_multiple_kernels> {
16881705 template <typename KernelName, int Dims, typename PropertiesT,
16891706 typename KernelType, typename Reduction>
1690- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1707+ static void run (handler &CGH,
1708+ const std::shared_ptr<detail::queue_impl> &Queue,
16911709 nd_range<Dims> NDRange, PropertiesT &Properties,
16921710 Reduction &Redu, KernelType &KernelFunc) {
16931711 static_assert (Reduction::has_identity,
@@ -1825,7 +1843,8 @@ struct NDRangeReduction<
18251843template <> struct NDRangeReduction <reduction::strategy::basic> {
18261844 template <typename KernelName, int Dims, typename PropertiesT,
18271845 typename KernelType, typename Reduction>
1828- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
1846+ static void run (handler &CGH,
1847+ const std::shared_ptr<detail::queue_impl> &Queue,
18291848 nd_range<Dims> NDRange, PropertiesT &Properties,
18301849 Reduction &Redu, KernelType &KernelFunc) {
18311850 using element_type = typename Reduction::reducer_element_type;
@@ -2600,9 +2619,9 @@ tuple_select_elements(TupleT Tuple, std::index_sequence<Is...>) {
26002619template <> struct NDRangeReduction <reduction::strategy::multi> {
26012620 template <typename KernelName, int Dims, typename PropertiesT,
26022621 typename ... RestT>
2603- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
2604- nd_range<Dims> NDRange, PropertiesT &Properties ,
2605- RestT... Rest) {
2622+ static void
2623+ run (handler &CGH, const std::shared_ptr<detail::queue_impl> &Queue ,
2624+ nd_range<Dims> NDRange, PropertiesT &Properties, RestT... Rest) {
26062625 std::tuple<RestT...> ArgsTuple (Rest...);
26072626 constexpr size_t NumArgs = sizeof ...(RestT);
26082627 auto KernelFunc = std::get<NumArgs - 1 >(ArgsTuple);
@@ -2644,7 +2663,8 @@ template <> struct NDRangeReduction<reduction::strategy::auto_select> {
26442663
26452664 template <typename KernelName, int Dims, typename PropertiesT,
26462665 typename KernelType, typename Reduction>
2647- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
2666+ static void run (handler &CGH,
2667+ const std::shared_ptr<detail::queue_impl> &Queue,
26482668 nd_range<Dims> NDRange, PropertiesT &Properties,
26492669 Reduction &Redu, KernelType &KernelFunc) {
26502670 auto Delegate = [&](auto Impl) {
@@ -2691,9 +2711,9 @@ template <> struct NDRangeReduction<reduction::strategy::auto_select> {
26912711 }
26922712 template <typename KernelName, int Dims, typename PropertiesT,
26932713 typename ... RestT>
2694- static void run (handler &CGH, std::shared_ptr<detail::queue_impl> &Queue,
2695- nd_range<Dims> NDRange, PropertiesT &Properties ,
2696- RestT... Rest) {
2714+ static void
2715+ run (handler &CGH, const std::shared_ptr<detail::queue_impl> &Queue ,
2716+ nd_range<Dims> NDRange, PropertiesT &Properties, RestT... Rest) {
26972717 return Impl<Strat::multi>::run<KernelName>(CGH, Queue, NDRange, Properties,
26982718 Rest...);
26992719 }
0 commit comments