DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::group< Dimensions > Class Template Reference

Encapsulates all functionality required to represent a particular work-group within a parallel execution. More...

#include <CL/sycl/detail/helpers.hpp>

Collaboration diagram for cl::sycl::group< Dimensions >:

Public Types

using id_type = id< Dimensions >
 
using range_type = range< Dimensions >
 
using linear_id_type = size_t
 

Public Member Functions

 group ()=delete
 
id< Dimensionsget_id () const
 
size_t get_id (int dimension) const
 
id< Dimensionsget_group_id () const
 
size_t get_group_id (int dimension) const
 
range< Dimensionsget_global_range () const
 
size_t get_global_range (int dimension) const
 
id< Dimensionsget_local_id () const
 
size_t get_local_linear_id () const
 
range< Dimensionsget_local_range () const
 
size_t get_local_range (int dimension) const
 
size_t get_local_linear_range () const
 
range< Dimensionsget_group_range () const
 
size_t get_group_range (int dimension) const
 
size_t get_group_linear_range () const
 
range< Dimensionsget_max_local_range () const
 
size_t operator[] (int dimension) const
 
size_t get_linear_id () const
 
size_t get_group_linear_id () const
 
bool leader () const
 
template<typename WorkItemFunctionT >
void parallel_for_work_item (WorkItemFunctionT Func) const
 
template<typename WorkItemFunctionT >
void parallel_for_work_item (range< Dimensions > flexibleRange, WorkItemFunctionT Func) const
 
template<access::mode accessMode = access::mode::read_write>
void mem_fence (typename detail::enable_if_t< accessMode==access::mode::read||accessMode==access::mode::write||accessMode==access::mode::read_write, access::fence_space > accessSpace=access::fence_space::global_and_local) const
 Executes a work-group mem-fence with memory ordering on the local address space, global address space or both based on the value of accessSpace. More...
 
template<typename dataT >
detail::enable_if_t<!detail::is_bool< dataT >::value, device_eventasync_work_group_copy (local_ptr< dataT > dest, global_ptr< dataT > src, size_t numElements, size_t srcStride) const
 Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest with a source stride specified by srcStride, and returns a SYCL device_event which can be used to wait on the completion of the copy. More...
 
template<typename dataT >
detail::enable_if_t<!detail::is_bool< dataT >::value, device_eventasync_work_group_copy (global_ptr< dataT > dest, local_ptr< dataT > src, size_t numElements, size_t destStride) const
 Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest with the destination stride specified by destStride, and returns a SYCL device_event which can be used to wait on the completion of the copy. More...
 
template<typename T , access::address_space DestS, access::address_space SrcS>
detail::enable_if_t< detail::is_scalar_bool< T >::value, device_eventasync_work_group_copy (multi_ptr< T, DestS > Dest, multi_ptr< T, SrcS > Src, size_t NumElements, size_t Stride) const
 Specialization for scalar bool type. More...
 
template<typename T , access::address_space DestS, access::address_space SrcS>
detail::enable_if_t< detail::is_vector_bool< T >::value, device_eventasync_work_group_copy (multi_ptr< T, DestS > Dest, multi_ptr< T, SrcS > Src, size_t NumElements, size_t Stride) const
 Specialization for vector bool type. More...
 
template<typename dataT >
device_event async_work_group_copy (local_ptr< dataT > dest, global_ptr< dataT > src, size_t numElements) const
 Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest and returns a SYCL device_event which can be used to wait on the completion of the copy. More...
 
template<typename dataT >
device_event async_work_group_copy (global_ptr< dataT > dest, local_ptr< dataT > src, size_t numElements) const
 Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest and returns a SYCL device_event which can be used to wait on the completion of the copy. More...
 
template<typename... eventTN>
void wait_for (eventTN... Events) const
 
bool operator== (const group< Dimensions > &rhs) const
 
bool operator!= (const group< Dimensions > &rhs) const
 

Static Public Attributes

static constexpr int dimensions = Dimensions
 
static constexpr sycl::memory_scope fence_scope
 

Protected Member Functions

 group (const range< Dimensions > &G, const range< Dimensions > &L, const range< Dimensions > GroupRange, const id< Dimensions > &I)
 

Friends

class detail::Builder
 

Detailed Description

template<int Dimensions = 1>
class cl::sycl::group< Dimensions >

Encapsulates all functionality required to represent a particular work-group within a parallel execution.

Definition at line 29 of file helpers.hpp.

Member Typedef Documentation

◆ id_type

template<int Dimensions = 1>
using cl::sycl::group< Dimensions >::id_type = id<Dimensions>

Definition at line 96 of file group.hpp.

◆ linear_id_type

template<int Dimensions = 1>
using cl::sycl::group< Dimensions >::linear_id_type = size_t

Definition at line 98 of file group.hpp.

◆ range_type

template<int Dimensions = 1>
using cl::sycl::group< Dimensions >::range_type = range<Dimensions>

Definition at line 97 of file group.hpp.

Constructor & Destructor Documentation

◆ group() [1/2]

template<int Dimensions = 1>
cl::sycl::group< Dimensions >::group ( )
delete

◆ group() [2/2]

template<int Dimensions = 1>
cl::sycl::group< Dimensions >::group ( const range< Dimensions > &  G,
const range< Dimensions > &  L,
const range< Dimensions GroupRange,
const id< Dimensions > &  I 
)
inlineprotected

Definition at line 521 of file group.hpp.

Member Function Documentation

◆ async_work_group_copy() [1/6]

template<int Dimensions = 1>
template<typename dataT >
device_event cl::sycl::group< Dimensions >::async_work_group_copy ( global_ptr< dataT >  dest,
local_ptr< dataT >  src,
size_t  numElements 
) const
inline

Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest and returns a SYCL device_event which can be used to wait on the completion of the copy.

Permitted types for dataT are all scalar and vector types.

Definition at line 385 of file group.hpp.

◆ async_work_group_copy() [2/6]

template<int Dimensions = 1>
template<typename dataT >
detail::enable_if_t<!detail::is_bool<dataT>::value, device_event> cl::sycl::group< Dimensions >::async_work_group_copy ( global_ptr< dataT >  dest,
local_ptr< dataT >  src,
size_t  numElements,
size_t  destStride 
) const
inline

Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest with the destination stride specified by destStride, and returns a SYCL device_event which can be used to wait on the completion of the copy.

Permitted types for dataT are all scalar and vector types, except boolean.

Definition at line 321 of file group.hpp.

◆ async_work_group_copy() [3/6]

template<int Dimensions = 1>
template<typename dataT >
device_event cl::sycl::group< Dimensions >::async_work_group_copy ( local_ptr< dataT >  dest,
global_ptr< dataT >  src,
size_t  numElements 
) const
inline

Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest and returns a SYCL device_event which can be used to wait on the completion of the copy.

Permitted types for dataT are all scalar and vector types.

Definition at line 373 of file group.hpp.

◆ async_work_group_copy() [4/6]

template<int Dimensions = 1>
template<typename dataT >
detail::enable_if_t<!detail::is_bool<dataT>::value, device_event> cl::sycl::group< Dimensions >::async_work_group_copy ( local_ptr< dataT >  dest,
global_ptr< dataT >  src,
size_t  numElements,
size_t  srcStride 
) const
inline

Asynchronously copies a number of elements specified by numElements from the source pointed by src to destination pointed by dest with a source stride specified by srcStride, and returns a SYCL device_event which can be used to wait on the completion of the copy.

Permitted types for dataT are all scalar and vector types, except boolean.

Definition at line 303 of file group.hpp.

◆ async_work_group_copy() [5/6]

template<int Dimensions = 1>
template<typename T , access::address_space DestS, access::address_space SrcS>
detail::enable_if_t<detail::is_scalar_bool<T>::value, device_event> cl::sycl::group< Dimensions >::async_work_group_copy ( multi_ptr< T, DestS >  Dest,
multi_ptr< T, SrcS >  Src,
size_t  NumElements,
size_t  Stride 
) const
inline

Specialization for scalar bool type.

Asynchronously copies a number of elements specified by NumElements from the source pointed by Src to destination pointed by Dest with a stride specified by Stride, and returns a SYCL device_event which can be used to wait on the completion of the copy.

Definition at line 339 of file group.hpp.

◆ async_work_group_copy() [6/6]

template<int Dimensions = 1>
template<typename T , access::address_space DestS, access::address_space SrcS>
detail::enable_if_t<detail::is_vector_bool<T>::value, device_event> cl::sycl::group< Dimensions >::async_work_group_copy ( multi_ptr< T, DestS >  Dest,
multi_ptr< T, SrcS >  Src,
size_t  NumElements,
size_t  Stride 
) const
inline

Specialization for vector bool type.

Asynchronously copies a number of elements specified by NumElements from the source pointed by Src to destination pointed by Dest with a stride specified by Stride, and returns a SYCL device_event which can be used to wait on the completion of the copy.

Definition at line 357 of file group.hpp.

◆ get_global_range() [1/2]

template<int Dimensions = 1>
range<Dimensions> cl::sycl::group< Dimensions >::get_global_range ( ) const
inline

Definition at line 117 of file group.hpp.

Referenced by cl::sycl::detail::writeGroup().

◆ get_global_range() [2/2]

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_global_range ( int  dimension) const
inline

Definition at line 119 of file group.hpp.

◆ get_group_id() [1/2]

template<int Dimensions = 1>
id<Dimensions> cl::sycl::group< Dimensions >::get_group_id ( ) const
inline

Definition at line 113 of file group.hpp.

◆ get_group_id() [2/2]

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_group_id ( int  dimension) const
inline

Definition at line 115 of file group.hpp.

◆ get_group_linear_id()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_group_linear_id ( ) const
inline

Definition at line 165 of file group.hpp.

◆ get_group_linear_range()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_group_linear_range ( ) const
inline

Definition at line 154 of file group.hpp.

◆ get_group_range() [1/2]

template<int Dimensions = 1>
range<Dimensions> cl::sycl::group< Dimensions >::get_group_range ( ) const
inline

Definition at line 148 of file group.hpp.

Referenced by cl::sycl::detail::writeGroup().

◆ get_group_range() [2/2]

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_group_range ( int  dimension) const
inline

Definition at line 150 of file group.hpp.

◆ get_id() [1/2]

template<int Dimensions = 1>
id<Dimensions> cl::sycl::group< Dimensions >::get_id ( ) const
inline

Definition at line 108 of file group.hpp.

Referenced by cl::sycl::detail::writeGroup().

◆ get_id() [2/2]

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_id ( int  dimension) const
inline

Definition at line 111 of file group.hpp.

◆ get_linear_id()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_linear_id ( ) const
inline

Definition at line 163 of file group.hpp.

◆ get_local_id()

template<int Dimensions = 1>
id<Dimensions> cl::sycl::group< Dimensions >::get_local_id ( ) const
inline

Definition at line 123 of file group.hpp.

◆ get_local_linear_id()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_local_linear_id ( ) const
inline

Definition at line 136 of file group.hpp.

◆ get_local_linear_range()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_local_linear_range ( ) const
inline

Definition at line 144 of file group.hpp.

◆ get_local_range() [1/2]

template<int Dimensions = 1>
range<Dimensions> cl::sycl::group< Dimensions >::get_local_range ( ) const
inline

Definition at line 140 of file group.hpp.

Referenced by cl::sycl::detail::writeGroup().

◆ get_local_range() [2/2]

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::get_local_range ( int  dimension) const
inline

Definition at line 142 of file group.hpp.

◆ get_max_local_range()

template<int Dimensions = 1>
range<Dimensions> cl::sycl::group< Dimensions >::get_max_local_range ( ) const
inline

Definition at line 158 of file group.hpp.

◆ leader()

template<int Dimensions = 1>
bool cl::sycl::group< Dimensions >::leader ( ) const
inline

Definition at line 167 of file group.hpp.

◆ mem_fence()

template<int Dimensions = 1>
template<access::mode accessMode = access::mode::read_write>
void cl::sycl::group< Dimensions >::mem_fence ( typename detail::enable_if_t< accessMode==access::mode::read||accessMode==access::mode::write||accessMode==access::mode::read_write, access::fence_space accessSpace = access::fence_space::global_and_local) const
inline

Executes a work-group mem-fence with memory ordering on the local address space, global address space or both based on the value of accessSpace.

Definition at line 278 of file group.hpp.

◆ operator!=()

template<int Dimensions = 1>
bool cl::sycl::group< Dimensions >::operator!= ( const group< Dimensions > &  rhs) const
inline

Definition at line 404 of file group.hpp.

◆ operator==()

template<int Dimensions = 1>
bool cl::sycl::group< Dimensions >::operator== ( const group< Dimensions > &  rhs) const
inline

Definition at line 396 of file group.hpp.

◆ operator[]()

template<int Dimensions = 1>
size_t cl::sycl::group< Dimensions >::operator[] ( int  dimension) const
inline

Definition at line 160 of file group.hpp.

◆ parallel_for_work_item() [1/2]

template<int Dimensions = 1>
template<typename WorkItemFunctionT >
void cl::sycl::group< Dimensions >::parallel_for_work_item ( range< Dimensions flexibleRange,
WorkItemFunctionT  Func 
) const
inline

Definition at line 221 of file group.hpp.

◆ parallel_for_work_item() [2/2]

template<int Dimensions = 1>
template<typename WorkItemFunctionT >
void cl::sycl::group< Dimensions >::parallel_for_work_item ( WorkItemFunctionT  Func) const
inline

Definition at line 170 of file group.hpp.

◆ wait_for()

template<int Dimensions = 1>
template<typename... eventTN>
void cl::sycl::group< Dimensions >::wait_for ( eventTN...  Events) const
inline

Definition at line 392 of file group.hpp.

Friends And Related Function Documentation

◆ detail::Builder

template<int Dimensions = 1>
friend class detail::Builder
friend

Definition at line 520 of file group.hpp.

Member Data Documentation

◆ dimensions

template<int Dimensions = 1>
constexpr int cl::sycl::group< Dimensions >::dimensions = Dimensions
staticconstexpr

Definition at line 99 of file group.hpp.

◆ fence_scope

template<int Dimensions = 1>
constexpr sycl::memory_scope cl::sycl::group< Dimensions >::fence_scope
staticconstexpr
Initial value:

Definition at line 102 of file group.hpp.


The documentation for this class was generated from the following files:
cl::sycl::memory_scope::work_group
@ work_group