SetLoadDataRepeat

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

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Sets the repeat parameters of the Load3Dv2 API. After the repeat parameters are 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

Description

repeatParams

Input

repeat parameters 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 path for storing files after the CANN software is installed.

For details about the parameter description, see Table 2.

Table 2 Parameters in the LoadDataRepeatParam structure

Parameter

Description

repeatTime

Number of iterations in the height/width direction. Value range: repeatTime ∈ [0, 255]. Default value: 1.

repeatStride

Distance between the start address of the previous iteration and the start address of the next iteration in the height/width direction. Value range: [0, 65535]. Default value: 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 350 Accelerator Card, the unit of repeatStride is 32/sizeof(data_type) elements.

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

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

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

repeatMode

Direction of the repeat iteration. Value range: [0, 1]. Default value: 0.

0: The iteration is in the height direction.

1: The iteration is in the width direction.

Examples

See Examples.