asc_brcb

产品支持情况

产品 是否支持
Atlas A3 训练系列产品/Atlas A3 推理系列产品
Atlas A2 训练系列产品/Atlas A2 推理系列产品

功能说明

给定一个输入矢量,每一次取输入矢量中的8个数填充到结果矢量的8个datablock(32Bytes)中去,每个数对应一个datablock。

函数原型

  • 高维切分计算

    __aicore__ inline void asc_brcb(__ubuf__ uint16_t* dst, __ubuf__ uint16_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat)
    __aicore__ inline void asc_brcb(__ubuf__ uint32_t* dst, __ubuf__ uint32_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat)
    
  • 同步高维切分计算

    __aicore__ inline void asc_brcb_sync(__ubuf__ uint16_t* dst, __ubuf__ uint16_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat)
    __aicore__ inline void asc_brcb_sync(__ubuf__ uint32_t* dst, __ubuf__ uint32_t* src, uint16_t dst_block_stride, uint16_t dst_repeat_stride, uint8_t repeat)
    

参数说明

参数名 输入/输出 描述
dst 输出 目的操作数(矢量)的起始地址。
src 输入 源操作数(矢量)的起始地址。
dst_block_stride 输入 目的操作数单次迭代内不同DataBlock间地址步长。
dst_repeat_stride 输入 目的操作数相邻迭代间相同DataBlock的地址步长。
repeat 输入 迭代次数。

返回值说明

流水类型

PIPE_V

约束说明

  • 不支持src与dst为同一块内存地址。

调用示例

constexpr uint32_t src_length = 16;
constexpr uint32_t dst_length = 256;
__ubuf__ uint16_t src[src_length];
__ubuf__ uint16_t dst[dst_length];
asc_brcb(dst, src, 1, 8, 2);

结果示例:

输入数据src:[1 2 3 ... 16]
输出数据dst:[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ... 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]