ResetLoopModePara

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Resets loop mode parameters. It is used together with SetLoopModePara. In data movement scenarios where loop mode is enabled and its parameters are configured, this parameter must be called upon the completion of data movement to reset the loop mode parameters.

Prototype

1
__aicore__ inline void ResetLoopModePara(DataCopyMVType type)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

type

Input

Data movement mode. DataCopyMVType is of the enumerated type and is defined as follows. For details about the parameters, see Table 3.

1
2
3
4
enum class DataCopyMVType : uint8_t {
    UB_TO_OUT = 0,
    OUT_TO_UB = 1,
};

Returns

None

Restrictions

None

Examples

In this example, the operand data type is int8_t.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
AscendC::LocalTensor<int8_t> srcLocal = inQueueSrc.AllocTensor<int8_t>();
AscendC::DataCopyExtParams copyParams{2, 48 * sizeof(int8_t), 0, 0, 0}; // The last parameter of DataCopyExtParams is reserved.
AscendC::DataCopyPadExtParams<half> padParams{false, 0, 0, 0};
AscendC::LoopModeParams loopParam2Ub {2, 2, 96, 128, 192, 288};
AscendC::SetLoopModePara(loopParam2Ub, DataCopyMVType::OUT_TO_UB);
AscendC::DataCopyPad<int8_t, PaddingMode::Compact>(srcLocal, srcGlobal, copyParams, padParams); // Move 384 bytes (48 × 2 × 2 × 2) from GM to VECIN.
AscendC::ResetLoopModePara(DataCopyMVType::OUT_TO_UB);
AscendC::LoopModeParams loopParam2Gm {2, 2, 128, 96, 288, 192};
AscendC::SetLoopModePara(loopParams2Gm, DataCopyMVType::UB_TO_OUT);
DataCopyPad<T, PaddingMode::Compact>(dstGlobal, srcLocal, copyParams);
AscendC::ResetLoopModePara(DataCopyMVType::UB_TO_OUT);