Concat

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

Preprocesses data, that is, merges the source operand src to be sorted into the target data concat. After the data is preprocessed, Sort can be performed.

Prototype

1
2
template <typename T>
__aicore__ inline void Concat(LocalTensor<T> &concat, const LocalTensor<T> &src, const LocalTensor<T> &tmp, const int32_t repeatTime)

Parameters

Table 1 Template parameters

Parameter

Description

T

Data type of an 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

concat

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.

src

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.

tmp

Input

Temporary space. It is used to store intermediate variables during complex internal computation of the API. The size of the temporary space is obtained by developers. For details about how to obtain the size, see GetConcatTmpSize. The data type must be the same as that of the 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.

repeatTime

Input

Number of iteration repeats. The type is int32_t. 16 elements are processed in each iteration, and the next 16 elements are processed in the next iteration. Value range: repeatTime ∈ [0, 255]

Returns

None

Constraints

Example

For details, see the examples in MrgSort.