Init

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

Atlas inference product Vector Core

x

Atlas training product

Function Usage

Initializes buffer and EventID for synchronizing pipeline events.

Prototype

1
__aicore__ inline void Init()

Constraints

This API must be used in pair with Destroy when TPipe resources are repeatedly allocated and released. If TPipe resources need to be repeatedly allocated, Destroy must be used to release the resources before Init is used.

Returns

None

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
// Instantiate a custom operator object of the float type.
KernelInit<float> op;
uint32_t srcSize = 128;

// First execution: Use pipeIn.
AscendC::TPipe pipeIn;
pipeIn.Init(); // Initialize pipeIn resources.
op.Init(x, z, srcSize, &pipeIn);
op.Process();
pipeIn.Destroy(); // Destroy pipeIn resources.

// Second execution: Reuse the operator object but use pipeCast.
AscendC::TPipe pipeCast;
pipeCast.Init(); // Initialize pipeCast resources.
op.Init(x, z, srcSize, &pipeCast);
op.Process();
pipeCast.Destroy(); // Destroy pipeCast resources.