Skip to content

asc_storealign_pack_postupdate_v2(废弃)

产品支持情况

  • Ascend 950PR/Ascend 950DT:支持
  • Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持
  • Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持
  • Atlas 200I/500 A2 推理产品:不支持
  • Atlas 推理系列产品AI Core:不支持
  • Atlas 推理系列产品Vector Core:不支持
  • Atlas 训练系列产品:不支持

功能说明

头文件路径为:"c_api/reg_compute/store/storealign.h"

该接口已废弃。请使用asc_storealign_pack_quarter_postupdate实现此功能。

将矢量数据寄存器中由mask指示的有效32bit元素的低8bit数据压缩搬出到Unified Buffer(UB)。本接口通过int32_t类型的offset传入偏移量,并启用Post Update模式自动更新目的操作数地址。

函数原型

C++
__simd_callee__ inline void asc_storealign_pack_postupdate_v2(__ubuf__ int32_t*& dst_align32b, vector_int32_t src, int32_t offset, vector_bool mask)
__simd_callee__ inline void asc_storealign_pack_postupdate_v2(__ubuf__ uint32_t*& dst_align32b, vector_uint32_t src, int32_t offset, vector_bool mask)
__simd_callee__ inline void asc_storealign_pack_postupdate_v2(__ubuf__ float*& dst_align32b, vector_float src, int32_t offset, vector_bool mask)

参数说明

表1 参数说明

参数名输入/输出描述
dst_align32b输入/输出目的操作数的起始地址,按指针引用传入,起始地址需32字节对齐。搬出完成后,该指针由硬件自动更新。
src输入源操作数(矢量数据寄存器)。支持的数据类型为int32_tuint32_tfloat
offset输入目的地址更新量,类型为int32_t,单位为元素。接口执行后,目的地址累加offset × sizeof(dtype)字节。
mask输入源操作数掩码(掩码寄存器),用于指示参与搬出的元素。对应位置为1时参与搬出,为0时不参与搬出。

矢量数据寄存器和掩码寄存器的详细说明请参见reg数据类型定义

返回值说明

流水类型

PIPE_V

约束说明

  • dst_align32b起始地址需32字节对齐。
  • Post Update后的dst_align32b新地址仍需32字节对齐。
  • mask需通过掩码设置接口预先赋值后再传入。

调用示例

C++
__ubuf__ int32_t* dst_align32b = (__ubuf__ int32_t*)asc_get_phy_buf_addr(0);
vector_int32_t src;
int32_t offset = 64;
vector_bool mask = asc_create_mask_b32(PAT_ALL);
asc_storealign_pack_postupdate_v2(dst_align32b, src, offset, mask);

免责声明:本站内容由 asc-devkit 仓 master 分支自动编译生成,属于持续开发版本,可能存在缺陷,仅供预览与参考。如需稳定及商用资料,请查阅官方 昇腾社区