DeInterleave
产品支持情况
功能说明
给定源操作数src0和src1,将src0和src1中的元素解交织存入结果操作数dst0和dst1中。解交织排列方式如下图所示,其中每个方格代表一个元素。

函数原型
-
两个输入
template <typename T> __aicore__ inline void DeInterleave(const LocalTensor<T>& dst0, const LocalTensor<T>& dst1, const LocalTensor<T>& src0, const LocalTensor<T>& src1, const int32_t count) -
一个输入
template <typename T> __aicore__ inline void DeInterleave(const LocalTensor<T>& dst0, const LocalTensor<T>& dst1, const LocalTensor<T>& src, const int32_t srcCount)
参数说明
表 1 模板参数说明
表 2 参数说明
|
类型为LocalTensor,支持的TPosition为VECIN/VECCALC/VECOUT。 Ascend 950PR/Ascend 950DT,支持的数据类型为:uint8_t/int8_t/uint16_t/int16_t/half/bfloat16_t/uint32_t/int32_t/float/uint64_t/int64_t |
||
|
类型为LocalTensor,支持的TPosition为VECIN/VECCALC/VECOUT。 Ascend 950PR/Ascend 950DT,支持的数据类型为:uint8_t/int8_t/uint16_t/int16_t/half/bfloat16_t/uint32_t/int32_t/float/uint64_t/int64_t |
||
返回值说明
无
约束说明
无
调用示例
本样例中只展示Compute流程中的部分代码。
-
两个输入
AscendC::DeInterleave(dst0Local, dst1Local, src0Local, src1Local, 512);结果示例如下:
输入数据src0Local: [1 2 3 ... 512] 输入数据src1Local: [513 514 515 ... 1024] 输出数据dst0Local: [1 3 5 ... 1023] 输出数据dst1Local: [2 4 6 ... 1024] -
一个输入
AscendC::DeInterleave(dst0Local, dst1Local, srcLocal, 512);结果示例如下:
输入数据srcLocal: [1 2 3 ... 512] 输出数据dst0Local: [1 3 5 ... 511] 输出数据dst1Local: [2 4 6 ... 512]