Constructor for TPipe

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

Constructs a TPipe object for managing buffers and synchronization.

Prototype

1
__aicore__ inline TPipe()

Constraints

  • Do not create or initialize TPipe inside an object. If TPipe is created inside an object, the optimization of constants in the object by the compiler may be affected, causing scalar performance deterioration. For details, see Preventing TPipe from Being Created and Initialized Inside the Object.
  • Only one TPipe object can exist globally at a time. If multiple TPipe objects are defined at the same time, random behaviors such as suspension may occur. If multiple TPipes are required, call Destroy to release the previous TPipe.

Returns

None

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
template <typename ComputeT> class KernelExample {
public:
    __aicore__ inline KernelExample() {}
    __aicore__ inline void Init(..., TPipe* pipeIn)
    {
        ...
        pipe = pipeIn;
        pipe->InitBuffer(xxxBuf, BUFFER_NUM, xxxSize);
        ...
    }
private:
    ...
    TPipe* pipe;
    ...
};
extern "C" __global__ __aicore__ void example_kernel(...) {
    ...
    TPipe pipe;
    KernelExample<float> op;
    op.Init(..., &pipe);
    ...
}