PopStackBuffer

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

Atlas training product

Function Usage

Allocates temporary space at a specified position (logical position). The space size is the remaining space of the specified position.

Prototype

template <typename T, TPosition pos>
__aicore__ inline bool PopStackBuffer(LocalTensor<T>& popLocal)

Parameters

Table 1 Template parameters

Parameter

Description

T

Data type of popLocal. The supported data types are uint8_t, int8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, and half.

pos

Position for which temporary space needs to be allocated. The data type is TPosition.

Table 2 Parameters

Parameter

Input/Output

Description

popLocal

Output

Tensor corresponding to the temporary space to be allocated. The tensor size is the remaining space of the corresponding position.

Returns

Function execution result. true: executed succeeded; false: executed failed.

Constraints

  • This API cannot be used in nested mode. For example, if PopStackBuffer is called in function A, it cannot be called in other functions that call function A.
  • This API is used in the internal implementation of high-level APIs. Therefore, this API cannot be called in the scenario where high-level APIs are called during operator implementation.

Example

AscendC::LocalTensor<int16_t> popBuffer;
bool ret = AscendC::PopStackBuffer<int16_t, AscendC::TPosition::VECCALC>(popBuffer);