GroupBarrier Constructor
Product Support
Product |
Supported |
|---|---|
x |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function
Creates a GroupBarrier object. You can set the constructor parameters to determine the number of blocks in the Arrive group and Wait group.
Prototype
1 2 3 | template <PipeMode pipeMode> class GroupBarrier; __aicore__ inline GroupBarrier(GM_ADDR groupWorkspace, uint32_t arriveSizeIn, uint32_t waitSizeIn); |
Parameters
Data Type |
Description |
||
|---|---|---|---|
PipeMode |
Execution unit used by GroupBarrier to send group synchronization messages. Only MTE3_MODE is supported.
|
Parameter |
Input/Output |
Description |
|---|---|---|
groupWorkspace |
Input |
Start address of the GroupBarrier object in the GM, which is used to store group synchronization messages. The address must be 512-byte aligned. Users manage such data in the global memory, including address alignment and clearing. |
arriveSizeIn |
Input |
Number of AIVs in the Arrive group. |
waitSizeIn |
Input |
Number of AIVs in the Wait group. |
Returns
A GroupBarrier object instance
Restrictions
- When this API is called, the 1600 bytes at the end of the UB space are occupied.
- This API cannot be used together with REGIST_MATMUL_OBJ. The resource management API is used by users to manage the inter-core communication between the AIC and AIV. In REGIST_MATMUL_OBJ, the framework manages the inter-core communication between the AIC and AIV. If they are used at the same time, exceptions such as communication message errors may occur.
Example
1 | AscendC::GroupBarrier<AscendC::PipeMode::MTE3_MODE> barA(startAddr, 3, 6); // Six AIVs start the subsequent service after three AIVs arrive. The required address space is 6 × 512 bytes in total. The start address is the user-specified startAddr. |