Wait

Product Support

Product

Supported

Atlas A3 training products/Atlas A3 inference products

x

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Function

Waits for executing tasks after all AIVs in the Arrive group have completed tasks.

Prototype

1
__aicore__ inline void Wait(uint32_t waitIndex)

Parameters

Table 1 API parameters

Parameter

Input/Output

Description

waitIndex

Input

Index of the AIV in the Wait group. Value range: [0, waitSize – 1].

Returns

None

Restrictions

This API can be used in iterations. However, the maximum number of iterations cannot exceed 1,048,575 due to the limitation of the inter-core communication efficiency.

Example

1
2
3
4
5
6
7
if (id >= 0 && id < ARRIVE_NUM) {
  //Various Vector compute logic, which is implemented by users.
  barA.Arrive(id);
} else if(id >= ARRIVE_NUM && id < ARRIVE_NUM + WAIT_NUM){
  barA.Wait(id - ARRIVE_NUM);                            // Six AIVs in the Wait group need to wait until the AIVs in the Arrive group complete tasks.
  // Various Vector compute logic, which is implemented by users.
}