Extract

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

x

Atlas inference product AI Core

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Processes the sorting result data and outputs the sorted values and indexes.

Prototype

1
2
template <typename T>
__aicore__ inline void Extract(const LocalTensor<T> &dstValue, const LocalTensor<uint32_t> &dstIndex, const LocalTensor<T> &sorted, const int32_t repeatTime)

Parameters

Table 1 Template parameters

Parameter

Description

T

Operand data type.

For the Atlas 350 Accelerator Card, the supported data types are half and float.

For the Atlas A3 training product/Atlas A3 inference product, the supported data types are half and float.

For the Atlas A2 training product/Atlas A2 inference product, the supported data types are half and float.

For the Atlas inference product AI Core, the supported data types are half and float.

Table 2 Parameters

Parameter

Input/Output

Description

dstValue

Output

Destination operand.

The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

dstIndex

Output

Destination operand.

The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

This source operand is fixed at the uint32_t data type.

sorted

Input

Source operand.

The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

The source operand must have the same data type as the destination operand.

repeatTime

Input

Number of iteration repeats. The value is of the int32_t type.

For the Atlas 350 Accelerator Card, 64 float elements or 128 half elements are processed in each iteration.

For the Atlas A3 training product/Atlas A3 inference product, 64 float elements or 128 half elements are processed in each iteration.

For the Atlas A2 training product/Atlas A2 inference product, 64 float elements or 128 half elements are processed in each iteration.

For the Atlas inference product AI Core, in each iteration, 16 elements are extracted from 16 Region Proposals and rearranged. The next group of 16 elements will be extracted from the next group of 16 Region Proposals in the next iteration.

Value range: repeatTime ∈ [0,255]

Returns

None

Constraints

Examples

For details, see the examples in MrgSort.