文档给出的样例文件路径 add_example/examples/test_aclnn_add_example.cpp 在项目根目录下不存在(实测 ls add_example/... → No such file or directory);真实路径是 examples/add_example/examples/test_aclnn_add_example.cpp。文档其他位置(第 120、238 行)都写的是 ops-ras/examples/add_example/...,此处少了 examples/ 前缀。
文档 §一.1 让用户按 git clone -b ${tag_version} https://gitcode.com/cann/ops-ras.git 下载源码(tag 为标签,如 v9.1.0),此时 HEAD 处于 detached 状态。实测在这样克隆出的源码目录执行 git branch 只输出 * (no branch),查不到任何版本信息;紧接着第 46 行说的“若源码已存在,执行 git pull 拉取最新源码”也失败:You are not currently on a branch. Please specify which branch you want to merge with.。
Document Link(文档链接)
https://gitcode.com/cann/ops-ras/blob/master/docs/QUICKSTART.md
https://gitcode.com/cann/ops-ras/blob/master/docs/QUICKSTART_en.md
Issues Section(问题文档片段)
add_example/examples/test_aclnn_add_example.cpp在项目根目录下不存在(实测ls add_example/...→ No such file or directory);真实路径是examples/add_example/examples/test_aclnn_add_example.cpp。文档其他位置(第 120、238 行)都写的是ops-ras/examples/add_example/...,此处少了examples/前缀。examples/add_example/examples/test_aclnn_add_example.cpp(或与全文统一为ops-ras/examples/add_example/examples/test_aclnn_add_example.cpp)。examples/add_example/op_kernel/add_example.h的 Init() 实际代码不一致:实际为blockLength_ = tilingData->totalLength / AscendC::GetBlockNum();与tileLength_ = blockLength_ / tileNum_ / BUFFER_NUM;,文档却给出了向上取整的三元表达式版本,读者在文件中找不到这些行。blockLength_ = tilingData->totalLength / AscendC::GetBlockNum();等),或只展示需要新增的// 打印当前核计算Block长度与AscendC::PRINTF("Tiling blockLength is %llu\n", blockLength_);两行并说明插入位置在 Init()git clone -b ${tag_version} https://gitcode.com/cann/ops-ras.git下载源码(tag 为标签,如 v9.1.0),此时 HEAD 处于 detached 状态。实测在这样克隆出的源码目录执行git branch只输出* (no branch),查不到任何版本信息;紧接着第 46 行说的“若源码已存在,执行git pull拉取最新源码”也失败:You are not currently on a branch. Please specify which branch you want to merge with.。git branch,查询当前源码版本。git describe --tags --always(或git log -1 --oneline);并说明检出 tag 后处于 detached HEAD,如需git pull应先git checkout <分支名>(或改用git fetch+ 重新git checkout <tag>)。blockLength_ = tilingData->totalLength / AscendC::GetBlockNum();与tileLength_ = blockLength_ / tileNum_ / BUFFER_NUM;。文档片段里的向上取整写法(tilingData->totalLength + AscendC::GetBlockNum() - 1) / ...和三元表达式((blockLength_ + tileNum_ - 1) / tileNum_ / BUFFER_NUM) ? ... : 1在源码中根本不存在(grep 均无命中)。照抄替换会改变分块/tile 切分逻辑,与“仅添加打印”的意图不符。AscendC::PRINTF("Tiling blockLength is %llu\n", blockLength_);一行,或直接说明“在上述 Init 的现有赋值语句之后追加一行 PRINTF”。out(std::vector<int64_t> outShape/outHostData/CreateAclTensor(..., &out))。按字面理解无法定位到要修改的对象。// === ② 参考selfX,同理修改selfY、out 的 shape 与数据 ===。Self-extractable archive "cann-ops-ras-custom_linux-${arch}.run" successfully created.,但本项目(9.1.0 分支/CANN 9.1.0)用第55行的编译命令实际产出的提示与产物名是Self-extractable archive "cann-ops-ras-custom-linux.x86_64.run" successfully created.:vendor 名与 linux 之间是连字符-而不是下划线_,架构标识是.x86_64而不是-${arch}。按原文给出的字符串比对会认为「没有出现成功提示」,且第67行暗示的产物名与 build_out 中真实文件(cann-ops-ras-custom-linux.x86_64.run)不符。Self-extractable archive "cann-ops-ras-custom-linux.x86_64.run" successfully created.(或写成cann-ops-ras-custom-linux.${arch}.run),并让紧随其后的「run包存放于 build_out 目录」示例名与之一致。examples/add_example/op_kernel/add_example.h中的代码,但仓库中该文件 Init() 实际为blockLength_ = tilingData->totalLength / AscendC::GetBlockNum();与tileLength_ = blockLength_ / tileNum_ / BUFFER_NUM;;示例多出的向上取整/三元保护与实际实现不同。逐字套用会静默改变分块计算(本次实测仍可编译运行,blockLength 256),但用户对照源码时会发现代码对不上。AscendC::PRINTF("Tiling blockLength is %llu\n", blockLength_);插入说明(并标注插入位置),或把示例中的三行改为文件当前实现。cann-ops-ras-custom_linux-${arch}.run(vendor 名后用下划线),而bash build.sh --pkg --soc=ascend910b --ops=add_example -j16的实际输出为Self-extractable archive "cann-ops-ras-custom-linux.x86_64.run" successfully created.(vendor 名后用连字符),build_out 下实际文件名也是cann-ops-ras-custom-linux.x86_64.run。Self-extractable archive "cann-ops-ras-${vendor_name}-linux.${arch}.run" successfully created.(或直接引用 build_out 下的实际文件名 cann-ops-ras-custom-linux.x86_64.run)。Existing Issues(存在的问题)
详见问题表格