PopStackBuffer
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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
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. |
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);