vector_dup
功能说明
该接口用于复制数据:
对于b16类型:将16位数据一次最多复制16*8个元素,写入目的地址。
对于b32类型:将32位数据一次最多复制8*8个元素,写入目的地址。
该接口支持通过MASK控制哪些元素参与计算。
接口原型
// 相同接口的不同原型区别在于源地址和目的地址的数据类型不同 void vector_dup(__ubuf__ bfloat16_t *dst, bfloat16_t src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ float *dst, float src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ int32_t *dst, int32_t src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ uint16_t *dst, uint16_t src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ uint32_t *dst, uint32_t src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ int16_t *dst, int16_t src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride); void vector_dup(__ubuf__ half *dst, half src, uint8_t repeat, uint16_t dstBlockStride, uint16_t srcBlockStride, uint16_t dstRepeatStride, uint16_t srcRepeatStride);
参数类型
参数名 |
说明 |
取值范围 |
单位 |
|---|---|---|---|
dst |
目的操作数起始地址。 |
/ |
/ |
src |
源操作数起始地址。 |
/ |
/ |
repeat |
接口迭代次数: b16:repeat = Num/(16*8); b32: repeat = Num/(8*8)。 |
[0, 2^8-1] |
/ |
dstBlockStride |
同一次执行,目的操作数不同block间地址步长。例如,当dstBlockStride为3,每个dst block的起始地址间隔为2个block(64B)。 |
[0, 2^8-1] |
32B |
srcBlockStride |
同一次执行,源操作数不同block间地址步长。 |
[0, 2^8-1] |
32B |
dstRepeatStride |
相邻两次执行,目的操作数相同block地址步长。0表示两次迭代的所有对应块指向相同的地址。 |
[0, 2^8-1] |
32B |
srcRepeatStride |
相邻两次执行,源操作数相同block地址步长。 |
[0, 2^8-1] |
32B |
参数表中的Stride均指代相邻两个首地址间的步长。
流水类型
PIPE_V
父主题: UB内搬移