Pull Request已成功合入, 合并人@CANN-robot
(感谢 Leechi666 的贡献)变更摘要
该 PR 修复 autofuse/tests/ut/device_validation/test_device_resources.cpp 的编译缺陷:该文件在 KernelModuleTest.V2RequestDoesNotProbeLegacySymbol 等用例中调用 std::find,但此前未显式包含 <algorithm>,其可见性依赖标准库头文件的传递包含(GCC 9 的 libstdc++ 恰好通过,GCC 14 精简传递包含后模板推导失败,导致 UT 编译报错)。修复方式是在该测试文件中显式补上 #include <algorithm>(1 行),消除对第三方/标准库头文件内部实现细节的依赖,使 UT 在文档声明的 GCC >= 7.3.0 环境中可确定性地编译通过。
主要改动
- 显式包含
<algorithm>头文件: 在autofuse/tests/ut/device_validation/test_device_resources.cpp的#include <gtest/gtest.h>之后新增#include <algorithm>,为文件中使用的std::find提供确定性声明来源。 - 消除传递包含依赖: 不再依赖
<unordered_map>等头文件内部对bits/stl_algo.h的传递包含行为,使 UT 编译结果在不同 GCC/libstdc++ 与 gtest 版本下保持稳定,修复 GCC 14 环境下的no matching function for call to 'find(...)'报错。


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/graph-autofusion | ✅ yangyongqiang0606, zhang_shengjie, liyuewei (3/2) | ✅ yangyongqiang0606 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm


/lgtm


/approve


Something went wrong during merge: git update-ref: exit status 128, stderr: "fatal: commit: cannot lock ref 'refs/heads/develop': is at 22122bec4e1489a00db52d1652dae9bc7e074b69 but expected 1e8bf172af55ffbbc46b45a1162ac9bffb64042b\n"
If you want to solve this problem, you can click here to do it in the FAQs.


/approve cancel


/check-pr


The following label is not ready.
approved: Please wait for committers to review the code.


@yangyongqiang0606 麻烦重新审批一下:上次 /approve 后的合并因 develop 分支被并发推进(git update-ref 竞态)而失败,approve 随之失效。当前 PR 已具备 ci-pipeline-passed 与两枚 lgtm,代码自上次审批以来无任何变更,重新 /approve 后即可正常合入。谢谢!


/approve


Pull Request
描述
autofuse/tests/ut/device_validation/test_device_resources.cpp:378使用std::find但文件未包含<algorithm>,其可见性完全依赖头文件传递包含:<unordered_map>(项目头引入)传递包含bits/stl_algo.h,编译碰巧通过;std::find声明不可见,模板推导失败,UT 编译报错,导致文档声明 GCC >= 7.3.0 可用但实际 ST/UT 验证流程无法走通。修复:显式包含
<algorithm>(1 行),消除对第三方/标准库头文件内部实现细节的依赖。变更类型
关联的Issue
如何测试
cmake --build build --target device_validation_ut -j 8完整编译链接通过(无错误、无新增告警);./build/autofuse/tests/ut/device_validation/device_validation_ut,136 个用例全部 PASSED,其中含出问题的KernelModuleTest.V2RequestDoesNotProbeLegacySymbol;no matching function for call to 'find(...)'),显式包含后确定性成立;核对清单
其他信息
分支基于 origin/develop(3ab20804),仅含 1 个提交(7824a372),无多余 commit。