Extract

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

Atlas inference product's Vector Core

x

Atlas training products

x

Function

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

Data type of the operand.

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

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

For the Atlas inference product's 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 the supported TPosition is VECIN, VECCALC, or VECOUT.

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

dstIndex

Output

Destination operand.

The type is LocalTensor, and the supported TPosition is VECIN, VECCALC, or VECOUT.

The start address of the 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 the supported TPosition is VECIN, VECCALC, or VECOUT.

The start address of the 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.

Atlas A3 training products/Atlas A3 inference products: 64 elements of the float type or 128 elements of the half type are processed in each iteration.

Atlas A2 training products/Atlas A2 inference products: 64 elements of the float type or 128 elements of the half type are processed in each iteration.

For the Atlas inference product's 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

Example

For details, see the examples in MrgSort.