DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
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< Dimensions > get_id () const
 
size_t get_id (int dimension) const
 
range< Dimensions > get_global_range () const
 
size_t get_global_range (int dimension) const
 
range< Dimensions > get_local_range () const
 
size_t get_local_range (int dimension) const
 
range< Dimensions > get_group_range () const
 
size_t get_group_range (int dimension) const
 
size_t operator[] (int dimension) const
 
template<int dims = Dimensions>
detail::enable_if_t<(dims==1), size_t > get_linear_id () const
 
template<int dims = Dimensions>
detail::enable_if_t<(dims==2), size_t > get_linear_id () const
 
template<int dims = Dimensions>
detail::enable_if_t<(dims==3), size_t > get_linear_id () 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 414 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 371 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 307 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 359 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 289 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 325 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 343 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 111 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 113 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 121 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 123 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 107 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 109 of file group.hpp.

◆ get_linear_id() [1/3]

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

Definition at line 130 of file group.hpp.

◆ get_linear_id() [2/3]

template<int Dimensions = 1>
template<int dims = Dimensions>
detail::enable_if_t<(dims == 2), size_t> cl::sycl::group< Dimensions >::get_linear_id ( ) const
inline

Definition at line 135 of file group.hpp.

◆ get_linear_id() [3/3]

template<int Dimensions = 1>
template<int dims = Dimensions>
detail::enable_if_t<(dims == 3), size_t> cl::sycl::group< Dimensions >::get_linear_id ( ) const
inline

Definition at line 150 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 117 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 119 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 264 of file group.hpp.

◆ operator!=()

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

Definition at line 390 of file group.hpp.

◆ operator==()

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

Definition at line 382 of file group.hpp.

◆ operator[]()

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

Definition at line 127 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 207 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 156 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 378 of file group.hpp.

Friends And Related Function Documentation

◆ detail::Builder

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

Definition at line 413 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