GetWorkspaceLen

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Returns the size of the global memory message space occupied by the current GroupBarrier object.

Prototype

1
__aicore__ inline uint64_t GetWorkspaceLen()

Parameters

None

Returns

Size of the global memory message space occupied by the current GroupBarrier object.

Restrictions

None

Example

1
2
3
// Six AIVs start the subsequent service after three AIVs arrive. The required address space is 6 x 512 bytes in total. The start address is the user-specified startAddr.
AscendC::GroupBarrier<AscendC::PipeMode::MTE3_MODE> barA(startAddr, 3, 6);
uint64_t offset = barA.GetWorkspaceLen(); // Return the size of space occupied by barA in the global memory.

Result example:

Occupied global memory space (offset): 3072