User-exposed API of Cooperative groups#
User-exposed API of Cooperative groups
Collaboration diagram for User-exposed API of Cooperative groups:
Functions | |
template<class CGTy > | |
uint32_t | cooperative_groups::group_size (CGTy const &g) |
Returns the size of the group. | |
template<class CGTy > | |
uint32_t | cooperative_groups::thread_rank (CGTy const &g) |
Returns the rank of thread of the group. | |
template<class CGTy > | |
bool | cooperative_groups::is_valid (CGTy const &g) |
Returns true if the group has not violated any API constraints. | |
template<class CGTy > | |
void | cooperative_groups::sync (CGTy const &g) |
Synchronizes the threads in the group. | |
Detailed Description
Function Documentation
◆ group_size()
template<class CGTy >
uint32_t cooperative_groups::group_size | ( | CGTy const & | g | ) |
Returns the size of the group.
Total number of threads in the thread group, and this serves the purpose for all derived cooperative group types because their size
is directly saved during the construction.
- Template Parameters
-
CGTy The cooperative group class template parameter.
- Parameters
-
g [in] The cooperative group for size returns.
- Note
- Implementation of publicly exposed
wrapper
API on top of basic cooperative group type APIs. This function is implemented on Linux and is under development on Microsoft Windows.
◆ is_valid()
template<class CGTy >
bool cooperative_groups::is_valid | ( | CGTy const & | g | ) |
Returns true if the group has not violated any API constraints.
- Template Parameters
-
CGTy The cooperative group class template parameter.
- Parameters
-
g [in] The cooperative group for validity check.
- Note
- Implementation of publicly exposed
wrapper
API on top of basic cooperative group type APIs. This function is implemented on Linux and is under development on Microsoft Windows.
◆ sync()
template<class CGTy >
void cooperative_groups::sync | ( | CGTy const & | g | ) |
Synchronizes the threads in the group.
- Template Parameters
-
CGTy The cooperative group class template parameter.
- Parameters
-
g [in] The cooperative group for synchronization.
- Note
- Implementation of publicly exposed
wrapper
API on top of basic cooperative group type APIs. This function is implemented on Linux and is under development on Microsoft Windows.
◆ thread_rank()
template<class CGTy >
uint32_t cooperative_groups::thread_rank | ( | CGTy const & | g | ) |
Returns the rank of thread of the group.
Rank of the calling thread within [0, size() ).
- Template Parameters
-
CGTy The cooperative group class template parameter.
- Parameters
-
g [in] The cooperative group for rank returns.
- Note
- Implementation of publicly exposed
wrapper
API on top of basic cooperative group type APIs. This function is implemented on Linux and is under development on Microsoft Windows.