Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangshunwei2 的贡献)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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| include/simt_api | ✅ zhanghao_0689, wulinyu (2/2) | ✅ zhanghao_0689 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


zhangshunwei2,感谢您的提交,建议在完成PR充分自验证后,再触发线上构建任务。
若您的PR已具备检视条件,可根据下表的责任田,@对应的committer进行代码检视,我们会在第一时间对您的提交进行处理。
代码责任田:
| module | committer |
|---|---|
| adv_api | chenyiyuan, wuyang_hw |
| basic_api | chenyiyuan, wuyang_hw |
| c_api | pangfd, yue_mo_du_qian |
| cmake | xun_zhuge, DragonBornHD84 |
| docs | munanhw, ai_xin |
| examples | changxianyu, bianque |
| simt_api | wulinyu, zhanghao_0689 |
| scripts | xun_zhuge, kevin365 |
| tools | YANXI_ZHAO, XuebinYang, sjtulxh |
💡 如您不确定可以@谁,可以直接@我或者ascend-c sig的maintainer,xun_zhuge和ascendhjh,我们会为您分配合适的committer进行代码检视。
再次感谢您参与CANN的社区贡献。


/compile


流水线任务触发成功
任务链接 [efe41876f6bf4ce9886e6b669e4bb6f1][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-06-25 09:44:53] CI执行结束


流水线任务触发成功
任务链接 [c34619c600a94b2c906bed09671cddb6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_adv_test_one | ✅ SUCCESS | ||
| UT_Test_adv_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_one | ✅ SUCCESS | ||
| UT_Test_basic_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_three | ✅ SUCCESS | ||
| UT_Test_basic_test_four | ✅ SUCCESS | ||
| UT_Test_basic_test_five | ✅ SUCCESS | ||
| UT_Test_arm | ✅ SUCCESS | ||
| UT_Test_report | ✅ SUCCESS | >>>>> |
[2026-06-25 09:51:14] CI执行结束


变更摘要
本次变更在 include/simt_api/math_functions.h 头文件中新增了 SIMT 数学函数的 max/min 系列接口声明,涵盖多种整数类型的比较取最大值/最小值功能。新增声明主要分为两组:一组是带 __SIMT_DEVICE_FUNCTIONS_DECL__ 修饰的 llmax/ullmax/umax/llmin/ullmin/umin 内联函数声明(第238–248行);另一组是 max/min 的重载声明块(第254–338行),根据不同编译条件(__NPU_COMPILER_INTERNAL_PURE_SIMT__、__NPU_ARCH__、ASCENDC_CPU_DEBUG)分别提供 static __callee__ 或 static __SIMT_DEVICE_FUNCTIONS_DECL__ 修饰的声明,覆盖 long long、unsigned long long、unsigned int、long、int、short、char、unsigned long、unsigned short、unsigned char 等类型。
主要改动
- 新增
llmax/ullmax/umax/llmin/ullmin/umin内联声明:在头文件中添加了6个带__SIMT_DEVICE_FUNCTIONS_DECL__修饰的整数取最大/最小值函数声明,作为对现有浮点fmaxf/fminf接口的补充。 - 新增
max/min多类型重载声明块:根据__NPU_COMPILER_INTERNAL_PURE_SIMT__、__NPU_ARCH__和ASCENDC_CPU_DEBUG三个编译条件分支,分别为 3510 架构提供static __callee__修饰的声明,为其他 SIMT 场景提供static __SIMT_DEVICE_FUNCTIONS_DECL__修饰的声明。 - 覆盖广泛的整数类型:
max/min重载覆盖了char、short、int、long、long long及其对应的unsigned变体,共10种整数类型。


/check-pr


The following labels are not ready.
lgtm: Please wait for reviewers to review the code.
approved: Please wait for committers to review the code.


/lgtm
/approve


描述
混合编程和SIMT编程场景下,提供cmath_lib类接口max、min,用于补充基础比较能力声明
关联的Issue
测试
文档更新
接口声明文件:include/simt_api/math_functions.h
类型标签