@@ -140,12 +140,19 @@ template <typename... Ts> ReduTupleT<Ts...> makeReduTupleT(Ts... Elements) {
140
140
return sycl::detail::make_tuple (Elements...);
141
141
}
142
142
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
143
149
__SYCL_EXPORT size_t reduGetMaxWGSize (std::shared_ptr<queue_impl> Queue,
144
150
size_t LocalMemBytesPerWorkItem);
145
- __SYCL_EXPORT size_t reduComputeWGSize (size_t NWorkItems, size_t MaxWGSize,
146
- size_t &NWorkGroups);
147
151
__SYCL_EXPORT size_t reduGetPreferredWGSize (std::shared_ptr<queue_impl> &Queue,
148
152
size_t LocalMemBytesPerWorkItem);
153
+ #endif
154
+ __SYCL_EXPORT size_t reduComputeWGSize (size_t NWorkItems, size_t MaxWGSize,
155
+ size_t &NWorkGroups);
149
156
150
157
template <typename T, class BinaryOperation , bool IsOptional>
151
158
class ReducerElement ;
@@ -1071,7 +1078,12 @@ class reduction_impl_algo {
1071
1078
std::shared_ptr<int > Counter (malloc_device<int >(1 , q), Deleter);
1072
1079
CGH.addReduction (Counter);
1073
1080
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);
1075
1087
1076
1088
return Counter.get ();
1077
1089
}
@@ -1229,7 +1241,8 @@ template <>
1229
1241
struct NDRangeReduction <reduction::strategy::local_atomic_and_atomic_cross_wg> {
1230
1242
template <typename KernelName, int Dims, typename PropertiesT,
1231
1243
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,
1233
1246
nd_range<Dims> NDRange, PropertiesT &Properties,
1234
1247
Reduction &Redu, KernelType &KernelFunc) {
1235
1248
static_assert (Reduction::has_identity,
@@ -1280,7 +1293,8 @@ struct NDRangeReduction<
1280
1293
reduction::strategy::group_reduce_and_last_wg_detection> {
1281
1294
template <typename KernelName, int Dims, typename PropertiesT,
1282
1295
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,
1284
1298
nd_range<Dims> NDRange, PropertiesT &Properties,
1285
1299
Reduction &Redu, KernelType &KernelFunc) {
1286
1300
static_assert (Reduction::has_identity,
@@ -1479,7 +1493,8 @@ void doTreeReductionOnTuple(size_t WorkSize, size_t LID,
1479
1493
template <> struct NDRangeReduction <reduction::strategy::range_basic> {
1480
1494
template <typename KernelName, int Dims, typename PropertiesT,
1481
1495
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,
1483
1498
nd_range<Dims> NDRange, PropertiesT &Properties,
1484
1499
Reduction &Redu, KernelType &KernelFunc) {
1485
1500
using reducer_type = typename Reduction::reducer_type;
@@ -1590,7 +1605,8 @@ template <>
1590
1605
struct NDRangeReduction <reduction::strategy::group_reduce_and_atomic_cross_wg> {
1591
1606
template <typename KernelName, int Dims, typename PropertiesT,
1592
1607
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,
1594
1610
nd_range<Dims> NDRange, PropertiesT &Properties,
1595
1611
Reduction &Redu, KernelType &KernelFunc) {
1596
1612
static_assert (Reduction::has_identity,
@@ -1626,7 +1642,8 @@ struct NDRangeReduction<
1626
1642
reduction::strategy::local_mem_tree_and_atomic_cross_wg> {
1627
1643
template <typename KernelName, int Dims, typename PropertiesT,
1628
1644
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,
1630
1647
nd_range<Dims> NDRange, PropertiesT &Properties,
1631
1648
Reduction &Redu, KernelType &KernelFunc) {
1632
1649
using reducer_type = typename Reduction::reducer_type;
@@ -1687,7 +1704,8 @@ struct NDRangeReduction<
1687
1704
reduction::strategy::group_reduce_and_multiple_kernels> {
1688
1705
template <typename KernelName, int Dims, typename PropertiesT,
1689
1706
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,
1691
1709
nd_range<Dims> NDRange, PropertiesT &Properties,
1692
1710
Reduction &Redu, KernelType &KernelFunc) {
1693
1711
static_assert (Reduction::has_identity,
@@ -1825,7 +1843,8 @@ struct NDRangeReduction<
1825
1843
template <> struct NDRangeReduction <reduction::strategy::basic> {
1826
1844
template <typename KernelName, int Dims, typename PropertiesT,
1827
1845
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,
1829
1848
nd_range<Dims> NDRange, PropertiesT &Properties,
1830
1849
Reduction &Redu, KernelType &KernelFunc) {
1831
1850
using element_type = typename Reduction::reducer_element_type;
@@ -2600,9 +2619,9 @@ tuple_select_elements(TupleT Tuple, std::index_sequence<Is...>) {
2600
2619
template <> struct NDRangeReduction <reduction::strategy::multi> {
2601
2620
template <typename KernelName, int Dims, typename PropertiesT,
2602
2621
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) {
2606
2625
std::tuple<RestT...> ArgsTuple (Rest...);
2607
2626
constexpr size_t NumArgs = sizeof ...(RestT);
2608
2627
auto KernelFunc = std::get<NumArgs - 1 >(ArgsTuple);
@@ -2644,7 +2663,8 @@ template <> struct NDRangeReduction<reduction::strategy::auto_select> {
2644
2663
2645
2664
template <typename KernelName, int Dims, typename PropertiesT,
2646
2665
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,
2648
2668
nd_range<Dims> NDRange, PropertiesT &Properties,
2649
2669
Reduction &Redu, KernelType &KernelFunc) {
2650
2670
auto Delegate = [&](auto Impl) {
@@ -2691,9 +2711,9 @@ template <> struct NDRangeReduction<reduction::strategy::auto_select> {
2691
2711
}
2692
2712
template <typename KernelName, int Dims, typename PropertiesT,
2693
2713
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) {
2697
2717
return Impl<Strat::multi>::run<KernelName>(CGH, Queue, NDRange, Properties,
2698
2718
Rest...);
2699
2719
}
0 commit comments