@@ -470,6 +470,74 @@ struct sub_group {
470
470
#endif
471
471
}
472
472
473
+ /* --- deprecated collective functions --- */
474
+ template <typename T>
475
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
476
+ " sycl::intel::broadcast instead." )
477
+ EnableIfIsScalarArithmetic<T> broadcast (T x, id<1 > local_id) const {
478
+ return sycl::detail::spirv::GroupBroadcast<sub_group>(x, local_id);
479
+ }
480
+
481
+ template <typename T, class BinaryOperation >
482
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
483
+ " sycl::intel::reduce instead." )
484
+ EnableIfIsScalarArithmetic<T> reduce (T x, BinaryOperation op) const {
485
+ return sycl::detail::calc<T, __spv::GroupOperation::Reduce,
486
+ __spv::Scope::Subgroup>(
487
+ typename sycl::detail::GroupOpTag<T>::type (), x, op);
488
+ }
489
+
490
+ template <typename T, class BinaryOperation >
491
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
492
+ " sycl::intel::reduce instead." )
493
+ EnableIfIsScalarArithmetic<T> reduce (T x, T init, BinaryOperation op) const {
494
+ return op (init, reduce (x, op));
495
+ }
496
+
497
+ template <typename T, class BinaryOperation >
498
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
499
+ " sycl::intel::exclusive_scan instead." )
500
+ EnableIfIsScalarArithmetic<T> exclusive_scan (T x, BinaryOperation op) const {
501
+ return sycl::detail::calc<T, __spv::GroupOperation::ExclusiveScan,
502
+ __spv::Scope::Subgroup>(
503
+ typename sycl::detail::GroupOpTag<T>::type (), x, op);
504
+ }
505
+
506
+ template <typename T, class BinaryOperation >
507
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
508
+ " sycl::intel::exclusive_scan instead." )
509
+ EnableIfIsScalarArithmetic<T> exclusive_scan (T x, T init,
510
+ BinaryOperation op) const {
511
+ if (get_local_id ().get (0 ) == 0 ) {
512
+ x = op (init, x);
513
+ }
514
+ T scan = exclusive_scan (x, op);
515
+ if (get_local_id ().get (0 ) == 0 ) {
516
+ scan = init;
517
+ }
518
+ return scan;
519
+ }
520
+
521
+ template <typename T, class BinaryOperation >
522
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
523
+ " sycl::intel::inclusive_scan instead." )
524
+ EnableIfIsScalarArithmetic<T> inclusive_scan (T x, BinaryOperation op) const {
525
+ return sycl::detail::calc<T, __spv::GroupOperation::InclusiveScan,
526
+ __spv::Scope::Subgroup>(
527
+ typename sycl::detail::GroupOpTag<T>::type (), x, op);
528
+ }
529
+
530
+ template <typename T, class BinaryOperation >
531
+ __SYCL_DEPRECATED (" Collectives in the sub-group class are deprecated. Use "
532
+ " sycl::intel::inclusive_scan instead." )
533
+ EnableIfIsScalarArithmetic<T> inclusive_scan (T x, BinaryOperation op,
534
+ T init) const {
535
+ if (get_local_id ().get (0 ) == 0 ) {
536
+ x = op (init, x);
537
+ }
538
+ return inclusive_scan (x, op);
539
+ }
540
+
473
541
protected:
474
542
template <int dimensions> friend class cl ::sycl::nd_item;
475
543
sub_group () = default ;
0 commit comments