合并受阻
变更摘要
本 PR 完成 CANN Code Detective Challenge05 中 MulCustom 逐元素乘法算子(z[i] = x[i] * y[i]),提交范围包含 mul_custom.asc、CMakeLists.txt 与 run.sh(不含构建产物)。mul_custom.asc 实现了设备侧 KernelMul 类(8 核数据切分、Double Buffer 双缓冲、CopyIn -> Compute -> CopyOut 流水)与主机侧 kernel_mul 封装(ACL 初始化、内存管理、Kernel 直调、流同步与结果回拷),并通过 main 中的 VerifyResult 完成真机精度验证。
主要改动
- 设备侧算子实现(
mul_custom.asc): 新增KernelMul类,在Init中按GetBlockNum()/GetBlockIdx()计算每核blockLength及 GM 地址偏移(blockOffset),并以BUFFER_NUM = 2的TQue(inQueueX/inQueueY/outQueueZ)初始化 Double Buffer。 - 流水处理流程:
Process按tileNum * BUFFER_NUM次循环依次执行CopyIn→Compute→CopyOut:CopyIn通过DataCopy将 GM 数据搬入 UB,Compute调用AscendC::Mul完成逐元素乘法,CopyOut将结果从 UB 写回 GM。 - Kernel 入口与 Host 侧封装: 新增
__global__ __aicore__入口函数mul_custom及kernel_mul函数,完成aclInit/aclrtSetDevice初始化、aclrtMalloc/aclrtMallocHost内存分配、mul_custom<<<blockDim, nullptr, stream>>>Kernel 直调、aclrtSynchronizeStream同步与ACL_MEMCPY_DEVICE_TO_HOST结果回拷,并逐一释放资源。 - 结果验证:
main构造1.2f * 2.3f的输入与 golden 向量,调用kernel_mul后由VerifyResult逐元素比较并输出[Success]/[Failed]判定。 - 构建运行脚本(
run.sh): 新增脚本,负责激活 CANN 环境(source "$ASCEND_TOOLKIT_HOME/set_env.sh")、创建build目录并通过cmake+make构建后运行./mul_test。


Hi @Qianqiuer, 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
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cann-outreach | ❌ (0/2)(You can also ask: 田晓亮, yanyawen, 傅涛, 王艳秋, li-shengxian3) | ❌ (0/1)(You can also ask: 田晓亮, Carolina_yuan, yanyawen, 王艳秋, yanhf) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Qianqiuer, thanks for your pull request. All authors of the commits have signed the CLA. 👍


变更描述 / Description
在
2026/CANN-Code-Detective/Challenge05-MulCustom/Qianqiuer/MulCustom中完成 MulCustom 逐元素乘法算子:TQue初始化;CopyIn -> Compute -> CopyOut流程实现流水处理;AscendC::Mul完成z[i] = x[i] * y[i];提交范围仅包含任务书要求的
mul_custom.asc、CMakeLists.txt和run.sh,不包含构建产物。改动类型 / Change Type
关联 Issue / Related Issues
测试信息 / Testing
ASCEND_RT_VISIBLE_DEVICES=0 bash run.sh验证结果:
检查清单 / Checklist