
asc_div【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit产品支持情况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/vector_compute/vector_compute.h。执行矢量除法运算。计算公式如下$$ dst_i src0_i ÷ src1_i $$函数原型前n个数据计算__aicore__ inline void asc_div(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint32_t count) __aicore__ inline void asc_div(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint32_t count)高维切分计算__aicore__ inline void asc_div(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint8_t repeat, uint8_t dst_block_stride, uint8_t src0_block_stride, uint8_t src1_block_stride, uint8_t dst_repeat_stride, uint8_t src0_repeat_stride, uint8_t src1_repeat_stride) __aicore__ inline void asc_div(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint8_t repeat, uint8_t dst_block_stride, uint8_t src0_block_stride, uint8_t src1_block_stride, uint8_t dst_repeat_stride, uint8_t src0_repeat_stride, uint8_t src1_repeat_stride)同步计算__aicore__ inline void asc_div_sync(__ubuf__ half* dst, __ubuf__ half* src0, __ubuf__ half* src1, uint32_t count) __aicore__ inline void asc_div_sync(__ubuf__ float* dst, __ubuf__ float* src0, __ubuf__ float* src1, uint32_t count)参数说明参数名输入/输出描述dst输出目的操作数矢量的起始地址src0输入源操作数矢量的起始地址src1输入源操作数矢量的起始地址repeat输入迭代次数。dst_block_stride输入目的操作数单次迭代内不同DataBlock间地址步长。src0_block_stride输入源操作数0单次迭代内不同DataBlock间地址步长。src1_block_stride输入源操作数1单次迭代内不同DataBlock间地址步长。dst_repeat_stride输入目的操作数相邻迭代间相同DataBlock的地址步长。src0_repeat_stride输入源操作数0相邻迭代间相同DataBlock的地址步长。src1_repeat_stride输入源操作数1相邻迭代间相同DataBlock的地址步长。count输入参与连续计算的元素个数返回值说明无流水类型PIPE_V约束说明dst、src0、src1的起始地址需要32字节对齐。操作数地址重叠约束请参考通用地址重叠约束。注意除0错误。调用示例//total_length指参与计算的数据长度 constexpr uint64_t total_length 64; __ubuf__ half src0[total_length]; __ubuf__ half src1[total_length]; __ubuf__ half dst[total_length]; asc_div(dst, src0, src1, total_length);【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考