SetLoadDataRepeat

Supported Products

Product

Supported/Unsupported

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product 's AI Core

x

Atlas inference product 's Vector Core

x

Atlas training products

x

Function Usage

Sets the repeat parameter of the Load3Dv2 API. After the repeat parameter is set, the Load3Dv2 API can be called once to complete the data movement for multiple iterations.

Prototype

1
__aicore__ inline void SetLoadDataRepeat(const LoadDataRepeatParam& repeatParams)

Parameters

Table 1 Parameters

Parameter

Input/Output

Meaning

repeatParams

Input

repeat parameter of the Load3Dv2 API, of the LoadDataRepeatParam type.

For details, see ${INSTALL_DIR}/include/ascendc/basic_api/interface/kernel_struct_mm.h. Replace ${INSTALL_DIR} with the actual CANN component directory.

For details about the parameter description, see Table 2.

Table 2 Parameters in the LoadDataRepeatParam structure

Parameter

Meaning

repeatTime

Number of iterations in the height/width direction. repeatTime ∈ [0, 255]. The default value is 1.

repeatStride

Distance between the start address of the previous iteration and the start address of the next iteration in the height/width direction. n ∈ [0, 65535]. The default value is 0.

  • When repeatMode is set to 0, the unit of repeatStride is 16 elements.
  • When repeatMode is set to 1, the unit of repeatStride is related to the model. In the following sections, data_type indicates the data type of the source operand in Load3Dv2.

    For the Atlas A2 training products / Atlas A2 inference products , the unit of repeatStride is 32/sizeof(data_type) elements.

    For the Atlas A3 training products / Atlas A3 inference products , the unit of repeatStride is 32/sizeof(data_type) elements.

    For the Atlas 200I/500 A2 inference products , the unit of repeatStride is 64/sizeof(data_type) elements.

repeatMode

Direction of the repeat iteration. The options are as follows: k ∈ [0, 1]. The default value is 0.

0: The iteration is in the height direction.

1: The iteration is in the width direction.

Example

See Example.