已合并
fix: Resolve formatting and UTF-8 compliance issues #1545
zhywang创建于 8月26日
fix: Resolve formatting and UTF-8 compliance issues #1545
已合并
zhywang创建于 8月26日
zhywang
8月26日

Created-by: cann-robot
Commit-by: cann-robot
Merged-by: cann-robot
Description: Fix source formatting, file endings, UTF-8 BOM encoding, and an invalid CANN license header.

描述

256 files changed, 359 insertions(+), 364 deletions(-).

  • 范围:更新 ISA Markdown 和 pkg_inc/README.md 的文本编码,并格式化 CPU、NPU、通信、manual kernel 及 ST 相关 C/C++ 文件。
  • 问题:部分文件存在尾随空白、缺少文件末尾换行或不符合 clang-format;237 个文档文件带 UTF-8 BOM;tmov_nd2zn_kernel.cpp 的许可证正文不符合 OAT 标准。
  • 修复:清理尾随空白并补齐文件末尾换行,应用 clang-format,移除全部已跟踪文件的 UTF-8 BOM,并将 tmov_nd2zn_kernel.cpp 更新为标准 CANN 2.0 许可证头。
  • 影响:仅调整格式、编码和许可证文本,不改变代码接口及运行语义。

关联的Issue

测试

  • gitcode_commit.py precheck --repo .
    • 结果:PASS,确认已 rebase 到 upstream/master,changed-files pre-commit 及 OAT 检查通过。
  • python3 -m pre_commit run trailing-whitespace --files
    • 结果:PASS。
  • python3 -m pre_commit run end-of-file-fixer --files
    • 结果:PASS。
  • python3 -m pre_commit run clang-format --files
    • 结果:PASS。
  • git diff --cached --check
    • 结果:PASS,确认 staged diff 无 whitespace error。
  • git ls-files -z | python3 -c ''
    • 结果:PASS,确认所有已跟踪普通文件均不含 UTF-8 BOM。

文档更新

将 236 个 ISA 文档及 pkg_inc/README.md 转换为无 BOM 的纯 UTF-8 编码。

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhywang 的贡献)
Zzhywang
8月26日 创建了 pull request,commit 70f3e32b
atomgit-bot
atomgit-bot
8月26日 评论:

变更摘要

本 PR 是一次纯格式、编码与许可证合规修复,不改变任何代码接口与运行语义。改动包括:对 CPU、NPU、通信、manual kernel 及 ST 相关 C/C++ 文件应用 clang-format(统一指针/引用写法、重排长签名与模板参数列表),清理尾随空白并补齐文件末尾换行,将 236 个 ISA 文档及 pkg_inc/README.md 转换为无 BOM 的纯 UTF-8 编码,并将 tmov_nd2zn_kernel.cpp 的许可证正文更新为标准的 CANN 2.0 许可证头。

主要改动

  • clang-format 风格规范化: 对 include/pto/cpu/ 下的 TGet.hpp、TPut.hpp、tile_offsets.hpp 以及 kernels/manual/a5/dispatch_mega_combine/ 下的 comm_mpi.h、data_utils.cpp/.hpp、kernel_launch.hpp、pto_vector.hpp、mega_wave_schedule.hpp 等文件统一指针声明写法(如 void * → void*、const std::string & → const std::string&),并重排 TGET_ASYNC_IMPL、CommMpiGather、PtoCastUb、GetExpertWaveRange 等函数的长签名及模板参数换行,仅涉及代码排版。
  • 尾随空白清理与文件末尾换行补齐: MXTypes.hpp 中 signaling_NaN() 后的行尾空格被移除;TExtract.hpp、tests/npu/a2a3/src/st/testcase/tconcatidx/main.cpp、tmov_nd2zn_kernel.cpp 等文件补上了缺失的文件末尾换行,消除 trailing-whitespace 与 end-of-file-fixer 检查告警。
  • 许可证头合规修正: tests/npu/a5/src/st/testcase/tmov_nd2zn/tmov_nd2zn_kernel.cpp 的许可证正文被改写为标准 CANN 2.0 文本(如 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED...),使其符合 OAT 标准。
  • 文档编码转换为无 BOM 的 UTF-8: 将 236 个 ISA 文档及 pkg_inc/README.md 的 UTF-8 BOM 移除,全部 237 个文档文件转为纯 UTF-8 编码,不影响文档内容。
likedislike
不准确?
atomgit-bot
atomgit-bot
8月26日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
8月26日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月26日 评论:

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
docs ✅ zhangjian_hz11, shengxinchen, csjlchen (3/2) ✅ zhangjian_hz11, shengxinchen (2/1)
repo-cann/pto-isa ✅ zhangjian_hz11, csjlchen (2/2) ✅ zhangjian_hz11 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

zhhywang, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
8月26日 将zhangjian_hz11,csjlchen,bluesky901,changxianyu,Zhanghaijian,syfeng,shengxinchen,yinjie27_,zhoubotcam,HuangXingYuan_777,linjiashu,WenboCodes,qukelin,ChanKaLok,kerwinair,echo_stone设为评审人
CANN-robotCANN-robot成员
8月26日 将zhangjian_hz11,csjlchen,bluesky901,changxianyu,Zhanghaijian,syfeng,shengxinchen,yinjie27_,zhoubotcam,HuangXingYuan_777,linjiashu,WenboCodes,qukelin,ChanKaLok,kerwinair,echo_stone设为审查人
zhywang
8月26日 评论:

/compile

likedislike
Zzhywang
8月26日 预合并成功(commit_id: 210574bcec9f04906cb5a9255b6ce9e14b9fa602)
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-failed
zhywang
8月26日 评论:

/compile

likedislike
Zzhywang
8月26日 预合并成功(commit_id: 15a6b53f0ac546f18249b6159b13206c8799fe32)
CANN-robotCANN-robot成员
8月26日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-failed
zhywang
8月26日 评论:

/compile

likedislike
CANN-robotCANN-robot成员
8月26日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月26日 添加了label:ci-pipeline-passed
shengxinchen成员
8月27日 评论:

/approve

likedislike
zhangjian_hz11成员
8月27日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
8月27日 添加了label:approved
csjlchen
csjlchen成员
8月27日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
8月27日 添加了label:lgtm
CANN-robotCANN-robot成员
8月27日 合入了pull request