clr/hipamd/include/hip/amd_detail/amd_hip_cooperative_groups.h Source File#
amd_hip_cooperative_groups.h
Go to the documentation of this file.
318 __CG_QUALIFIER__ void barrier_wait(arrival_token&&) const { internal::workgroup::barrier_wait(); }
405 friend __CG_QUALIFIER__ coalesced_group binary_partition(const coalesced_group& cgrp, bool pred);
1019__CG_QUALIFIER__ thread_group tiled_partition(const thread_group& parent, unsigned int tile_size) {
1033__CG_QUALIFIER__ thread_group tiled_partition(const thread_block& parent, unsigned int tile_size) {
1037__CG_QUALIFIER__ tiled_group tiled_partition(const tiled_group& parent, unsigned int tile_size) {
1233 static_assert(size <= ParentSize, "Sub tile size must be <= parent tile size in tiled_partition");
1235 __CG_QUALIFIER__ tiled_partition_internal(const thread_block_tile<ParentSize, GrandParentCGTy>& g)
The coalesced_group cooperative group type.
Definition amd_hip_cooperative_groups.h:398
The grid cooperative group type.
Definition amd_hip_cooperative_groups.h:195
Definition amd_hip_cooperative_groups.h:1051
thread_block_tile_internal(const thread_block &g)
Definition amd_hip_cooperative_groups.h:1057
thread_block_tile_internal(const thread_block_tile_internal< tbtSize, tbtParentT > &g)
Definition amd_hip_cooperative_groups.h:1053
The multi-grid cooperative group type.
Definition amd_hip_cooperative_groups.h:140
User exposed API that captures the state of the parent group pre-partition.
Definition amd_hip_cooperative_groups.h:919
thread_block_tile(const thread_block_tile< size, ParentCGTy > &g)
Definition amd_hip_cooperative_groups.h:1214
Definition amd_hip_cooperative_groups.h:860
Group type - thread_block_tile.
Definition amd_hip_cooperative_groups.h:942
Group type - thread_block_tile.
Definition amd_hip_cooperative_groups.h:1071
T shfl_down(T var, unsigned int lane_delta) const
Shuffle down operation on group level.
unsigned long long ballot(int pred) const
Ballot function on group level.
thread_block_tile(const ParentCGTy &g)
Definition amd_hip_cooperative_groups.h:1073
unsigned int meta_group_rank() const
unsigned int thread_rank() const
Rank of the calling thread within [0, num_threads() ).
T shfl_xor(T var, unsigned int laneMask) const
Shuffle xor operation on group level.
unsigned long long match_any(T value) const
Match any function on group level.
unsigned long long match_all(T value, int &pred) const
Match all function on group level.
unsigned int meta_group_size() const
Returns the number of groups created when the parent group was partitioned.
T shfl_up(T var, unsigned int lane_delta) const
Shuffle up operation on group level.
T shfl(T var, int srcRank) const
Shuffle operation on group level.
The workgroup (thread-block in CUDA terminology) cooperative group type.
Definition amd_hip_cooperative_groups.h:251
The base type of all cooperative group types.
Definition amd_hip_cooperative_groups.h:50
Definition amd_hip_cooperative_groups.h:837
The tiled_group cooperative group type.
Definition amd_hip_cooperative_groups.h:342
const struct texture< T, dim, readMode > const void size_t size
Definition hip_runtime_api.h:10067
bool is_valid(CGTy const &g)
Returns true if the group has not violated any API constraints.
Definition amd_hip_cooperative_groups.h:816
void sync(CGTy const &g)
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:827
__hip_uint32_t group_size(CGTy const &g)
Returns the size of the group.
Definition amd_hip_cooperative_groups.h:788
__hip_uint32_t thread_rank(CGTy const &g)
Returns the rank of thread of the group.
Definition amd_hip_cooperative_groups.h:803
thread_block this_thread_block()
User-exposed API interface to construct workgroup cooperative group type object - thread_block.
Definition amd_hip_cooperative_groups.h:331
coalesced_group binary_partition(const coalesced_group &cgrp, bool pred)
Binary partition.
Definition amd_hip_cooperative_groups.h:1270
thread_group tiled_partition(const thread_group &parent, unsigned int tile_size)
User-exposed API to partition groups.
Definition amd_hip_cooperative_groups.h:1019
multi_grid_group this_multi_grid()
User-exposed API interface to construct grid cooperative group type object - multi_grid_group.
Definition amd_hip_cooperative_groups.h:181
coalesced_group coalesced_threads()
User-exposed API to create coalesced groups.
Definition amd_hip_cooperative_groups.h:672
grid_group this_grid()
User-exposed API interface to construct grid cooperative group type object - grid_group.
Definition amd_hip_cooperative_groups.h:240
void sync() const
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:386
T shfl_xor(T var, unsigned int laneMask) const
Definition amd_hip_cooperative_groups.h:891
static constexpr unsigned int numThreads
Definition amd_hip_cooperative_groups.h:839
friend multi_grid_group this_multi_grid()
User-exposed API interface to construct grid cooperative group type object - multi_grid_group.
Definition amd_hip_cooperative_groups.h:181
void sync() const
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:486
static void sync()
Definition amd_hip_cooperative_groups.h:877
void barrier_wait(arrival_token &&t) const
Arrive at a barrier.
Definition amd_hip_cooperative_groups.h:225
unsigned int num_threads
Definition amd_hip_cooperative_groups.h:72
__hip_uint32_t thread_rank() const
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:207
arrival_token barrier_arrive() const
Arrive at a barrier.
Definition amd_hip_cooperative_groups.h:219
void sync() const
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:213
__hip_uint32_t size() const
Total number of threads in the group (alias of num_threads())
Definition amd_hip_cooperative_groups.h:94
unsigned int size() const
Total number of threads in the group (alias of num_threads())
Definition amd_hip_cooperative_groups.h:478
__hip_uint32_t num_grids()
Definition amd_hip_cooperative_groups.h:153
unsigned long long match_all(T value, int &pred) const
Definition amd_hip_cooperative_groups.h:910
unsigned long long match_any(T value) const
Match any function on group level.
Definition amd_hip_cooperative_groups.h:638
friend thread_block this_thread_block()
User-exposed API interface to construct workgroup cooperative group type object - thread_block.
Definition amd_hip_cooperative_groups.h:331
static unsigned int meta_group_size()
Returns the number of groups created when the parent group was partitioned.
Definition amd_hip_cooperative_groups.h:928
unsigned int signal
Definition amd_hip_cooperative_groups.h:216
unsigned int meta_group_rank() const
Definition amd_hip_cooperative_groups.h:490
dim3 group_dim() const
Definition amd_hip_cooperative_groups.h:214
unsigned int meta_group_rank() const
Definition amd_hip_cooperative_groups.h:993
__hip_uint32_t _num_threads
Type of the thread_group.
Definition amd_hip_cooperative_groups.h:53
__hip_uint32_t block_rank() const
Rank of the block in calling thread within [0, num_threads() ).
static unsigned int num_threads()
Number of threads within this tile.
Definition amd_hip_cooperative_groups.h:848
thread_group(internal::group_type type, __hip_uint32_t num_threads=static_cast< __hip_uint64_t >(0), __hip_uint64_t mask=static_cast< __hip_uint64_t >(0))
Definition amd_hip_cooperative_groups.h:62
unsigned int meta_group_size() const
Returns the number of groups created when the parent group was partitioned.
Definition amd_hip_cooperative_groups.h:495
unsigned int thread_rank() const
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:382
unsigned int thread_rank() const
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:481
unsigned int meta_group_size() const
Returns the number of groups created when the parent group was partitioned.
Definition amd_hip_cooperative_groups.h:998
int all(int pred) const
All function on group level.
Definition amd_hip_cooperative_groups.h:626
unsigned int cg_type() const
Returns the type of the group.
Definition amd_hip_cooperative_groups.h:96
T shfl(T var, int srcRank) const
Definition amd_hip_cooperative_groups.h:879
thread_group new_tiled_group(unsigned int tile_size) const
Definition amd_hip_cooperative_groups.h:265
static __hip_uint32_t size()
Total number of threads in the group (alias of num_threads())
Definition amd_hip_cooperative_groups.h:304
unsigned int num_threads() const
Definition amd_hip_cooperative_groups.h:374
unsigned int num_threads() const
Definition amd_hip_cooperative_groups.h:475
void barrier_wait(arrival_token &&) const
Arrive at a barrier.
Definition amd_hip_cooperative_groups.h:318
tiled_group(unsigned int tileSize)
Definition amd_hip_cooperative_groups.h:366
unsigned int meta_group_rank
Definition amd_hip_cooperative_groups.h:73
unsigned long long match_all(T value, int &pred) const
Match all function on group level.
Definition amd_hip_cooperative_groups.h:655
thread_block_tile_type()
Definition amd_hip_cooperative_groups.h:947
__hip_uint32_t block_rank() const
Rank of the block in calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:209
grid_group(__hip_uint32_t size)
Construct grid thread group (through the API this_grid())
Definition amd_hip_cooperative_groups.h:202
__hip_uint32_t grid_rank()
Definition amd_hip_cooperative_groups.h:157
static constexpr unsigned int thread_rank()
Rank of the thread within this tile.
Definition amd_hip_cooperative_groups.h:843
bool is_tiled
Definition amd_hip_cooperative_groups.h:71
unsigned long long ballot(int pred) const
Ballot function on group level.
Definition amd_hip_cooperative_groups.h:604
void sync() const
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:165
T shfl_up(T var, unsigned int lane_delta) const
Definition amd_hip_cooperative_groups.h:887
static __hip_uint32_t block_rank()
Rank of the block in calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:296
static dim3 group_index()
Returns 3-dimensional block index within the grid.
Definition amd_hip_cooperative_groups.h:288
unsigned int num_threads
Definition amd_hip_cooperative_groups.h:79
static void sync()
Synchronizes the threads in the group.
Definition amd_hip_cooperative_groups.h:308
friend coalesced_group binary_partition(const thread_block_tile< fsize, fparent > &tgrp, bool pred)
__hip_uint32_t thread_rank() const
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:159
bool is_valid() const
Returns true if the group has not violated any API constraints.
static unsigned int size()
Definition amd_hip_cooperative_groups.h:852
friend thread_group tiled_partition(const thread_group &parent, unsigned int tile_size)
User-exposed API to partition groups.
Definition amd_hip_cooperative_groups.h:1019
int any(int pred) const
Definition amd_hip_cooperative_groups.h:901
int all(int pred) const
Definition amd_hip_cooperative_groups.h:903
__hip_uint64_t _mask
Total number of threads in the thread_group.
Definition amd_hip_cooperative_groups.h:54
friend thread_group this_thread()
Definition amd_hip_cooperative_groups.h:1007
bool is_valid() const
Returns true if the group has not violated any API constraints.
Definition amd_hip_cooperative_groups.h:211
__hip_uint32_t _type
Definition amd_hip_cooperative_groups.h:52
unsigned long long match_any(T value) const
Definition amd_hip_cooperative_groups.h:905
unsigned int size() const
Total number of threads in the group (alias of num_threads())
Definition amd_hip_cooperative_groups.h:379
struct cooperative_groups::thread_group::_coalesced_info coalesced_info
lane_mask member_mask
Definition amd_hip_cooperative_groups.h:78
thread_block(__hip_uint32_t size)
Definition amd_hip_cooperative_groups.h:262
unsigned int meta_group_size
Definition amd_hip_cooperative_groups.h:74
multi_grid_group(__hip_uint32_t size)
Construct multi-grid thread group (through the API this_multi_grid())
Definition amd_hip_cooperative_groups.h:147
int any(int pred) const
Any function on group level.
Definition amd_hip_cooperative_groups.h:616
thread_group this_thread()
Definition amd_hip_cooperative_groups.h:1007
static unsigned int meta_group_rank()
Definition amd_hip_cooperative_groups.h:923
__hip_uint32_t num_threads() const
Definition amd_hip_cooperative_groups.h:92
struct _tiled_info tiled_info
Definition amd_hip_cooperative_groups.h:80
friend coalesced_group coalesced_threads()
User-exposed API to create coalesced groups.
Definition amd_hip_cooperative_groups.h:672
friend coalesced_group binary_partition(const coalesced_group &cgrp, bool pred)
Binary partition.
Definition amd_hip_cooperative_groups.h:1270
static dim3 thread_index()
Returns 3-dimensional thread index within the block.
Definition amd_hip_cooperative_groups.h:290
friend class thread_block
Definition amd_hip_cooperative_groups.h:86
coalesced_group(lane_mask member_mask)
Definition amd_hip_cooperative_groups.h:463
T shfl_down(T var, unsigned int lane_delta) const
Shuffle down operation on group level.
Definition amd_hip_cooperative_groups.h:536
static bool is_valid()
Returns true if the group has not violated any API constraints.
Definition amd_hip_cooperative_groups.h:306
dim3 group_dim()
Returns the group dimensions.
Definition amd_hip_cooperative_groups.h:310
thread_block_tile_type(unsigned int meta_group_rank, unsigned int meta_group_size)
Definition amd_hip_cooperative_groups.h:976
static __hip_uint32_t num_threads()
Definition amd_hip_cooperative_groups.h:300
unsigned long long ballot(int pred) const
Definition amd_hip_cooperative_groups.h:896
T shfl(T var, int srcRank) const
Shuffle operation on group level.
Definition amd_hip_cooperative_groups.h:511
arrival_token barrier_arrive() const
Arrive at a barrier.
Definition amd_hip_cooperative_groups.h:313
bool is_valid() const
Returns true if the group has not violated any API constraints.
Definition amd_hip_cooperative_groups.h:163
static __hip_uint32_t thread_rank()
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:292
friend grid_group this_grid()
User-exposed API interface to construct grid cooperative group type object - grid_group.
Definition amd_hip_cooperative_groups.h:240
T shfl_down(T var, unsigned int lane_delta) const
Definition amd_hip_cooperative_groups.h:883
T shfl_up(T var, unsigned int lane_delta) const
Shuffle up operation on group level.
Definition amd_hip_cooperative_groups.h:573
thread_block_tile_type(unsigned int meta_group_rank, unsigned int meta_group_size)
Definition amd_hip_cooperative_groups.h:952
__hip_uint32_t thread_rank() const
Rank of the calling thread within [0, num_threads() ).
Definition amd_hip_cooperative_groups.h:40
Definition amd_hip_cooperative_groups.h:215
tiled_partition_internal(const thread_block &g)
Definition amd_hip_cooperative_groups.h:1225
tiled_partition_internal(const thread_block_tile< ParentSize, GrandParentCGTy > &g)
Definition amd_hip_cooperative_groups.h:1235
Definition amd_hip_cooperative_groups.h:1221
Definition amd_hip_cooperative_groups.h:311
Definition amd_hip_cooperative_groups.h:77
Definition amd_hip_cooperative_groups.h:70
Definition hip_runtime_api.h:1299