Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhaojianing2025 的贡献)变更摘要
本 PR 完成 Challenge05 的 MulCustom float32 逐元素乘法算子(z[i] = x[i] * y[i]),新增 mul_custom.asc 与 run.sh 两个文件。核心是实现了 KernelMul 的 Init、Process、CopyIn、Compute、CopyOut 全流程,使用 AscendC::Mul 完成计算,并配套 Host 侧 ACL 内存管理、Kernel 启动与结果校验逻辑。
主要改动
- 算子 Kernel 实现: 新增
mul_custom.asc,定义MulCustomTilingData(含totalLength、tileNum)与KernelMul类,实现Init、Process、CopyIn、Compute、CopyOut,其中Compute通过AscendC::Mul(zLocal, xLocal, yLocal, tileLength)完成逐元素乘法,Process按tileNum * BUFFER_NUM循环调度拷贝与计算。 - 数据切分与流水:
Init中按AscendC::GetBlockNum()(8 核)切分blockLength,并以BUFFER_NUM = 2(Double Buffer)初始化inQueueX、inQueueY、outQueueZ三个队列,CopyIn/CopyOut以progress * tileLength为偏移执行DataCopy。 - Host 侧封装与启动: 新增
kernel_mul函数,通过 ACL 接口(aclInit、aclrtMalloc、aclrtMemcpy、aclrtSynchronizeStream等)完成设备内存分配、数据搬运、以mul_custom<<<blockDim, nullptr, stream>>>启动 Kernel(blockDim = 8、tileNum = 8)并将结果回拷;main中构造totalLength = 8 * 2048的输入并调用VerifyResult与 golden 结果比对。 - 构建运行脚本: 新增
run.sh,通过source "$ASCEND_TOOLKIT_HOME/set_env.sh"激活 CANN 环境,并依次执行cmake、make及运行./mul_test,用于算子编译与运行验证。


Hi @zhaojianing2025, welcome to submitting your first PR to cann-outreach!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cann-outreach | ✅ shaoyf, 傅涛 (2/2) | ✅ shaoyf, 傅涛 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaojianing2025, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


/check-cla


/compile


CLA检查未通过,详情可参考这里


/check-cla


CLA检查未通过,详情可参考这里


/check-cla


/compile


CLA检查已通过,详情可参考这里


/compile


/check-cla


/compile


CLA检查已通过,详情可参考这里


/check-cla


/compile


CLA检查已通过,详情可参考这里


当前PR是否有AI参与:
[ ] 否
[x] 是
__1. AI Agent 平台: OpenAI Codex
__2. AI 模型: GPT-5.6 Sol
__3. Prompt上下文: 阅读 Challenge05 任务书和多个已提交 PR,完成 MulCustom 的 Kernel、Host 侧实现、静态检查、提交规范核对及 PR 提交流程。
PR功能描述 / 为什么需要这个合入**:
完成 Challenge05 MulCustom float32 逐元素乘法算子,实现
z[i] = x[i] * y[i]。主要实现:
KernelMul的Init、Process、CopyIn、Compute和CopyOutAscendC::Mul实现逐元素乘法该PR关联的issue
References https://gitcode.com/cann/cann-learning-hub/issues/700
希望检视人员了解:
代码已通过
git diff --check、脚本语法和提交文件范围检查,并在 CANN 9.0.0、Ascend910B(dav-2201)Simulator 环境完成编译和运行验证。验证结果:
验证截图:

改动类型 / Change Type
测试信息 / Testing
检查清单 / Checklist