Move

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

Replicates elements from src to the corresponding positions in dst. If there is an input mask, only the valid elements selected by the mask are copied, and invalid elements are filled with 0.

Prototype

  • There is an input mask.
    __simd_callee__ inline void Move(MaskReg& dst, MaskReg& src, MaskReg& mask)
  • There are no input masks.
    __simd_callee__ inline void Move(MaskReg& dst, MaskReg& src)

Parameters

Table 1 Parameters

Parameter

Description

dst

Destination operand.

src

Source operand.

mask

This parameter indicates which bits are valid during the copy process.

Returns

None

Restrictions

None

Examples

template <typename T>
__simd_vf__ inline void MoveVF(__ubuf__ T* dstAddr, __ubuf__ T* srcAddr, uint32_t count, uint32_t oneRepeatSize, uint16_t repeatTimes)
{
    AscendC::Reg::RegTensor<T> srcReg;
    AscendC::Reg::MaskReg src = AscendC::Reg::CreateMask<T, AscendC::Reg::MaskPattern::ALLF>();
    AscendC::Reg::MaskReg dst;
    AscendC::Reg::MaskReg mask;
    for (uint16_t i = 0; i < repeatTimes; ++i) {
        mask = AscendC::Reg::UpdateMask<T>(count);
        AscendC::Reg::LoadAlign(srcReg, srcAddr + i * oneRepeatSize);
        AscendC::Reg::Move(dst, src, mask);
        AscendC::Reg::Adds(srcReg, srcReg, 0, dst);
        AscendC::Reg::StoreAlign(dstAddr + i * oneRepeatSize, srcReg, mask);
    }
}