DPC++ Runtime
Runtime libraries for oneAPI DPC++
group_algorithm.hpp File Reference
#include <sycl/detail/array.hpp>
#include <sycl/detail/helpers.hpp>
#include <sycl/detail/item_base.hpp>
#include <sycl/detail/type_list.hpp>
#include <sycl/detail/type_traits.hpp>
#include <sycl/exception.hpp>
#include <sycl/functional.hpp>
#include <sycl/group.hpp>
#include <sycl/half_type.hpp>
#include <sycl/id.hpp>
#include <sycl/known_identity.hpp>
#include <sycl/nd_item.hpp>
#include <sycl/range.hpp>
#include <sycl/sub_group.hpp>
#include <sycl/types.hpp>
#include <stddef.h>
#include <type_traits>
Include dependency graph for group_algorithm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sycl::_V1::detail::is_native_op< T, BinaryOperation >
 
struct  sycl::_V1::detail::is_complex< T, typename >
 
struct  sycl::_V1::detail::is_vector_arithmetic_or_complex< T >
 
struct  sycl::_V1::detail::get_scalar_binary_op< F< sycl::vec< T, n > > >
 
struct  sycl::_V1::detail::get_scalar_binary_op< F< void > >
 
struct  sycl::_V1::detail::is_max_or_min< T >
 
struct  sycl::_V1::detail::is_max_or_min< sycl::maximum< T > >
 
struct  sycl::_V1::detail::is_max_or_min< sycl::minimum< T > >
 

Namespaces

 sycl
 
 sycl::_V1
 
 sycl::_V1::detail
 

Typedefs

template<typename T >
using sycl::_V1::detail::native_op_list = type_list< sycl::plus< T >, sycl::bit_or< T >, sycl::bit_xor< T >, sycl::bit_and< T >, sycl::maximum< T >, sycl::minimum< T >, sycl::multiplies< T >, sycl::logical_or< T >, sycl::logical_and< T > >
 
template<typename T , typename BinaryOperation >
using sycl::_V1::detail::is_plus = std::integral_constant< bool, std::is_same_v< BinaryOperation, sycl::plus< std::remove_const_t< T > >>||std::is_same_v< BinaryOperation, sycl::plus< std::add_const_t< T > >>||std::is_same_v< BinaryOperation, sycl::plus< void > >>
 
template<typename T , typename BinaryOperation >
using sycl::_V1::detail::is_multiplies = std::integral_constant< bool, std::is_same_v< BinaryOperation, sycl::multiplies< std::remove_const_t< T > >>||std::is_same_v< BinaryOperation, sycl::multiplies< std::add_const_t< T > >>||std::is_same_v< BinaryOperation, sycl::multiplies< void > >>
 
template<typename T >
using sycl::_V1::detail::is_arithmetic_or_complex = std::integral_constant< bool, sycl::detail::is_complex< T >::value||sycl::detail::is_arithmetic< T >::value >
 
template<typename T , typename BinaryOperation >
using sycl::_V1::detail::is_plus_or_multiplies_if_complex = std::integral_constant< bool,(is_complex< T >::value ?(is_plus< T, BinaryOperation >::value||is_multiplies< T, BinaryOperation >::value) :std::true_type::value)>
 

Functions

template<int Dimensions>
id< Dimensions > sycl::_V1::detail::linear_id_to_id (range< Dimensions >, size_t linear_id)
 
template<>
id< 1 > sycl::_V1::detail::linear_id_to_id (range< 1 >, size_t linear_id)
 
template<>
id< 2 > sycl::_V1::detail::linear_id_to_id (range< 2 > r, size_t linear_id)
 
template<>
id< 3 > sycl::_V1::detail::linear_id_to_id (range< 3 > r, size_t linear_id)
 
template<typename Group >
size_t sycl::_V1::detail::get_local_linear_range (Group g)
 
template<>
size_t sycl::_V1::detail::get_local_linear_range< group< 1 > > (group< 1 > g)
 
template<>
size_t sycl::_V1::detail::get_local_linear_range< group< 2 > > (group< 2 > g)
 
template<>
size_t sycl::_V1::detail::get_local_linear_range< group< 3 > > (group< 3 > g)
 
template<>
size_t sycl::_V1::detail::get_local_linear_range< sycl::sub_group > (sycl::sub_group g)
 
template<typename Group >
Group::linear_id_type sycl::_V1::detail::get_local_linear_id (Group g)
 
template<>
sycl::sub_group::linear_id_type sycl::_V1::detail::get_local_linear_id< sycl::sub_group > (sycl::sub_group g)
 
template<typename T , class BinaryOperation >
constexpr std::enable_if_t<(is_complex< T >::value &&is_plus< T, BinaryOperation >::value), T > sycl::_V1::detail::identity_for_ga_op ()
 
template<typename T , class BinaryOperation >
constexpr std::enable_if_t<(is_complex< T >::value &&is_multiplies< T, BinaryOperation >::value), T > sycl::_V1::detail::identity_for_ga_op ()
 
template<typename T , class BinaryOperation >
constexpr std::enable_if_t<!is_complex< T >::value, T > sycl::_V1::detail::identity_for_ga_op ()
 
template<typename Group , typename Ptr , class Function >
Function sycl::_V1::detail::for_each (Group g, Ptr first, Ptr last, Function f)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< T >::value||(detail::is_complex< T >::value &&detail::is_multiplies< T, BinaryOperation >::value)) &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::reduce_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_complex< T >::value &&detail::is_native_op< T, sycl::plus< T >>::value &&detail::is_plus< T, BinaryOperation >::value), T > sycl::_V1::reduce_over_group (Group g, T x, BinaryOperation)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::reduce_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename V , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< V >::value||detail::is_complex< V >::value) &&(detail::is_scalar_arithmetic< T >::value||detail::is_complex< T >::value) &&detail::is_native_op< T, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value &&std::is_convertible_v< V, T >), T > sycl::_V1::reduce_over_group (Group g, V x, T init, BinaryOperation binary_op)
 
template<typename Group , typename V , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< V >::value &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< V, BinaryOperation >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::reduce_over_group (Group g, V x, T init, BinaryOperation binary_op)
 
template<typename Group , typename Ptr , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< Ptr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< Ptr >::type >::value &&detail::is_arithmetic_or_complex< T >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::joint_reduce (Group g, Ptr first, Ptr last, T init, BinaryOperation binary_op)
 
template<typename Group , typename Ptr , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< Ptr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< Ptr >::type >::value &&detail::is_plus_or_multiplies_if_complex< typename detail::remove_pointer< Ptr >::type, BinaryOperation >::value), typename detail::remove_pointer< Ptr >::type > sycl::_V1::joint_reduce (Group g, Ptr first, Ptr last, BinaryOperation binary_op)
 
template<typename Group >
std::enable_if_t< is_group_v< std::decay_t< Group > >, bool > sycl::_V1::any_of_group (Group g, bool pred)
 
template<typename Group , typename T , class Predicate >
std::enable_if_t< is_group_v< Group >, bool > sycl::_V1::any_of_group (Group g, T x, Predicate pred)
 
template<typename Group , typename Ptr , class Predicate >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< Ptr >), bool > sycl::_V1::joint_any_of (Group g, Ptr first, Ptr last, Predicate pred)
 
template<typename Group >
std::enable_if_t< is_group_v< std::decay_t< Group > >, bool > sycl::_V1::all_of_group (Group g, bool pred)
 
template<typename Group , typename T , class Predicate >
std::enable_if_t< is_group_v< std::decay_t< Group > >, bool > sycl::_V1::all_of_group (Group g, T x, Predicate pred)
 
template<typename Group , typename Ptr , class Predicate >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< Ptr >), bool > sycl::_V1::joint_all_of (Group g, Ptr first, Ptr last, Predicate pred)
 
template<typename Group >
std::enable_if_t< is_group_v< std::decay_t< Group > >, bool > sycl::_V1::none_of_group (Group g, bool pred)
 
template<typename Group , typename T , class Predicate >
std::enable_if_t< is_group_v< std::decay_t< Group > >, bool > sycl::_V1::none_of_group (Group g, T x, Predicate pred)
 
template<typename Group , typename Ptr , class Predicate >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< Ptr >), bool > sycl::_V1::joint_none_of (Group g, Ptr first, Ptr last, Predicate pred)
 
template<typename Group , typename T >
std::enable_if_t<(std::is_same_v< std::decay_t< Group >, sub_group > &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::shift_group_left (Group, T x, typename Group::linear_id_type delta=1)
 
template<typename Group , typename T >
std::enable_if_t<(std::is_same_v< std::decay_t< Group >, sub_group > &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::shift_group_right (Group, T x, typename Group::linear_id_type delta=1)
 
template<typename Group , typename T >
std::enable_if_t<(std::is_same_v< std::decay_t< Group >, sub_group > &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::permute_group_by_xor (Group, T x, typename Group::linear_id_type mask)
 
template<typename Group , typename T >
std::enable_if_t<(std::is_same_v< std::decay_t< Group >, sub_group > &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::select_from_group (Group, T x, typename Group::id_type local_id)
 
template<typename Group , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::group_broadcast (Group g, T x, typename Group::id_type local_id)
 
template<typename Group , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::group_broadcast (Group g, T x, typename Group::linear_id_type linear_local_id)
 
template<typename Group , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(std::is_trivially_copyable_v< T >||detail::is_vec< T >::value)), T > sycl::_V1::group_broadcast (Group g, T x)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< T >::value||(detail::is_complex< T >::value &&detail::is_multiplies< T, BinaryOperation >::value)) &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::exclusive_scan_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_complex< T >::value &&detail::is_native_op< T, sycl::plus< T >>::value &&detail::is_plus< T, BinaryOperation >::value), T > sycl::_V1::exclusive_scan_over_group (Group g, T x, BinaryOperation)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::exclusive_scan_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename V , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< V >::value &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< V, BinaryOperation >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::exclusive_scan_over_group (Group g, V x, T init, BinaryOperation binary_op)
 
template<typename Group , typename V , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< V >::value||detail::is_complex< V >::value) &&(detail::is_scalar_arithmetic< T >::value||detail::is_complex< T >::value) &&detail::is_native_op< T, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value &&std::is_convertible_v< V, T >), T > sycl::_V1::exclusive_scan_over_group (Group g, V x, T init, BinaryOperation binary_op)
 
template<typename Group , typename InPtr , typename OutPtr , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< InPtr > &&detail::is_pointer_v< OutPtr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< InPtr >::type >::value &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< OutPtr >::type >::value &&detail::is_arithmetic_or_complex< T >::value &&detail::is_native_op< T, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value), OutPtr > sycl::_V1::joint_exclusive_scan (Group g, InPtr first, InPtr last, OutPtr result, T init, BinaryOperation binary_op)
 
template<typename Group , typename InPtr , typename OutPtr , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< InPtr > &&detail::is_pointer_v< OutPtr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< InPtr >::type >::value &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< OutPtr >::type >::value &&detail::is_native_op< typename detail::remove_pointer< OutPtr >::type, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< typename detail::remove_pointer< OutPtr >::type, BinaryOperation >::value), OutPtr > sycl::_V1::joint_exclusive_scan (Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::inclusive_scan_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< T >::value||(detail::is_complex< T >::value &&detail::is_multiplies< T, BinaryOperation >::value)) &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::inclusive_scan_over_group (Group g, T x, BinaryOperation binary_op)
 
template<typename Group , typename T , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_complex< T >::value &&detail::is_native_op< T, sycl::plus< T >>::value &&detail::is_plus< T, BinaryOperation >::value), T > sycl::_V1::inclusive_scan_over_group (Group g, T x, BinaryOperation)
 
template<typename Group , typename V , class BinaryOperation , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&(detail::is_scalar_arithmetic< V >::value||detail::is_complex< V >::value) &&(detail::is_scalar_arithmetic< T >::value||detail::is_complex< T >::value) &&detail::is_native_op< T, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value &&std::is_convertible_v< V, T >), T > sycl::_V1::inclusive_scan_over_group (Group g, V x, BinaryOperation binary_op, T init)
 
template<typename Group , typename V , class BinaryOperation , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_vector_arithmetic_or_complex< V >::value &&detail::is_vector_arithmetic_or_complex< T >::value &&detail::is_native_op< V, BinaryOperation >::value &&detail::is_native_op< T, BinaryOperation >::value), T > sycl::_V1::inclusive_scan_over_group (Group g, V x, BinaryOperation binary_op, T init)
 
template<typename Group , typename InPtr , typename OutPtr , class BinaryOperation , typename T >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< InPtr > &&detail::is_pointer_v< OutPtr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< InPtr >::type >::value &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< OutPtr >::type >::value &&detail::is_arithmetic_or_complex< T >::value &&detail::is_native_op< T, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< T, BinaryOperation >::value), OutPtr > sycl::_V1::joint_inclusive_scan (Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op, T init)
 
template<typename Group , typename InPtr , typename OutPtr , class BinaryOperation >
std::enable_if_t<(is_group_v< std::decay_t< Group >> &&detail::is_pointer_v< InPtr > &&detail::is_pointer_v< OutPtr > &&detail::is_arithmetic_or_complex< typename detail::remove_pointer< InPtr >::type >::value &&detail::is_native_op< typename detail::remove_pointer< OutPtr >::type, BinaryOperation >::value &&detail::is_plus_or_multiplies_if_complex< typename detail::remove_pointer< OutPtr >::type, BinaryOperation >::value), OutPtr > sycl::_V1::joint_inclusive_scan (Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op)