| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
【PR】: fix: sample 易用性规范性优化 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !2067 merge master into master 【PR】: fix: sample 易用性规范性优化 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: # Pull Request ## 描述 1、sample样例 readme规范化 整改 2、sample样例 补充优化注释 3、sample样例 cmakelist 连接包优化,libascendcl.so -> libacl_rt.so 4、新增一键导入 SOC_VERSION和ASCENDC_CMAKE_DIR变量的工具 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. example/0_quickstart/4_custom_kernel_launch Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully with <<<>>> kernel call! 2. 样例执行验证 ===== START 0_quickstart/0_hello_cann ===== RESULT 0_quickstart/0_hello_cann rc=0 -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build/main Run the sample: ./build/main ACL init successfully Set device 0 successfully Create stream successfully Input vectors: self: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] other: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] alpha: 1.0 Create output aclDataBuffer successfully, buffer addr = 0x12e0c0016000 Get workspace size successfully, workspace size = 0 Launch aclnnAdd successfully Synchronize stream successfully Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully! ===== END 0_quickstart/0_hello_cann ===== ===== START 0_quickstart/1_error_handling ===== RESULT 0_quickstart/1_error_handling rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build/main Run the sample: ./build/main [INFO] ACL init and set device successfully [INFO] Current run mode: ACL_HOST [INFO] Triggering an expected invalid-parameter error with aclrtGetRunMode(nullptr) [ERROR] Diagnostics: ret=100000, peekErr=0, lastErr=0, recentErrMsg=[PID: 334883] 2026-05-12-16:34:08.984.159 Invalid_Argument_Null_Pointer(EH0002): Argument [runMode] must not be null. Solution: Try again with a correct pointer argument. [WARN] aclrtGetErrorVerbose(0) returned error code 207000 [INFO] After diagnostics are consumed once: peekErr=207000, lastErr=207000, recentErrMsg=<null> [INFO] ACL finalize successfully ===== END 0_quickstart/1_error_handling ===== ===== START 0_quickstart/2_system_info ===== RESULT 0_quickstart/2_system_info rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build/main Run the sample: ./build/main [INFO] ACL init successfully [INFO] ACL Runtime API version: 1.16.0 [INFO] CANN package [runtime] version string: 9.0.0 [INFO] CANN package [runtime] version number: 90000000 [INFO] Current run mode: ACL_HOST [INFO] Float conversion: 1.625000 -> 0x3e80 -> 1.625000 [INFO] Data type size: ACL_FLOAT=4, ACL_FLOAT16=2, ACL_INT64=8 [INFO] ACL finalize successfully ===== END 0_quickstart/2_system_info ===== ===== START 1_basic_features/device/0_device_normal ===== RESULT 1_basic_features/device/0_device_normal rc=0 [INFO]: Current compile soc version is ascend910_9362 -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/1_basic_features/device/0_device_normal/build [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main -- Install configuration: \"Debug\" [INFO] Start to run device_normal sample. [INFO] result[0] is: 1.200000 [INFO] result[1] is: 2.200000 [INFO] result[2] is: 3.200000 [INFO] result[3] is: 5.400000 [INFO] result[4] is: 6.400000 [INFO] result[5] is: 7.400000 [INFO] result[6] is: 9.600000 [INFO] result[7] is: 10.600000 [INFO] Run the device_normal sample successfully. ===== END 1_basic_features/device/0_device_normal ===== ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2067 | 2 个月前 | |
【PR】: move ipc_event to advanced feature Co-authored-by: good_luck_to_me<qiaoruimin@huawei.com> # message auto-generated for no-merge-commit merge: !2403 merge ipc_event_new into master 【PR】: move ipc_event to advanced feature Created-by: good_luck_to_me Commit-by: good_luck_to_me Merged-by: cann-robot Description: # Pull Request ## 描述 move ipc_event to advanced feature ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 ## 核对清单 <!-- [x] 表示选中 --> - [ x] 我的代码遵循了项目的代码风格 - [x ] 我已对代码进行了自测 - [x ] 我已更新了相关的文档 - [x ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2403 | 2 个月前 | |
feat: 添加 aclGraph 条件操作 sample(IF/WHILE/SWITCH 及嵌套组合) Co-authored-by: good_luck_to_me<qiaoruimin@huawei.com> # message auto-generated for no-merge-commit merge: !2809 merge sample/acl_graph_cond_model into master feat: 添加 aclGraph 条件操作 sample(IF/WHILE/SWITCH 及嵌套组合) Created-by: good_luck_to_me Commit-by: good_luck_to_me Merged-by: cann-robot Description: # Pull Request ## 描述 添加 aclGraph 条件操作(IF/WHILE/SWITCH 及嵌套组合)的可运行 sample,覆盖 对应典型场景: 1. IF 条件双分支验证(true/false) 2. WHILE 单次迭代循环 3. SWITCH 多分支选择 ## 变更类型 - [x] ✨ 新功能 ## 如何测试 1. 设置 CANN 环境变量 2. cd example/2_advanced_features/model_ri/3_cond_model 3. bash run.sh 注意:需要 CANN 版本支持 aclGraph 条件操作 API ## 核对清单 - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签 See merge request: cann/runtime!2809 | 1 个月前 | |
优化example示例中 产品支持情况 描述 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1276 merge sample into master 优化example示例中 产品支持情况 描述 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、补充部分新增example示例 readme 缺少的“产品支持情况”描述 2、历史example示例 readme 中“产品支持情况”与docs中API描述不一致 3、优化example样例执行步骤,run.sh中编译完成后自动执行,将原来编译+运行 2步操作 合为一步 4、目录 README 补全: 为 device、stream、event、memory、kernel、callback、model_ri、notify、tdt_buffer、tdt_channel、tdt_queue、built_in_task 等目录新增了 README.md,改善了导航体验 5、链接路径修正: 修正了嵌套目录的相对路径(从 ../../README.md 改为 ../../../README.md) 代码审查报告 https://gitcode.com/cann/runtime/pull/1276?ref=&did=65e24693459e9d96f1d4ad02bef022d0968fba55#tid-166839878 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/299 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> /example/0_quickstart/0_hello_cann$ bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build/main Run the sample: ./build/main ACL init successfully Set device 0 successfully Create stream successfully Input vectors: self: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] other: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] alpha: 1.0 Create output aclDataBuffer successfully, buffer addr = 0x12c0c0016000 Get workspace size successfully, workspace size = 0 [Warning]: tiling struct [ReduceOpTilingDataV2] is conflict with one in file kl_div_v2.cc, line 41 [Warning]: tiling struct [RepeatInterleaveGradTilingData] is conflict with one in file repeat_interleave_grad_tiling.h, line 21 [Warning]: tiling struct [IndexFillTilingData] is conflict with one in file index_fill_tiling.h, line 21 [Warning]: tiling struct [MapIndexTilingData] is conflict with one in file map_index_tiling_arch35.h, line 23 [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [Warning]: tiling struct [MaskedSelectV3TilingData] is conflict with one in file masked_select_v3_tiling.h, line 27 [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [Warning]: tiling struct [ScatterPaKvCacheTilingData] is conflict with one in file scatter_pa_kv_cache_tiling.h, line 35 [Warning]: tiling struct [TopKTopPSampleTilingData] is conflict with one in file top_k_top_p_sample_tiling.h, line 26 [Warning]: tiling struct [AvgPool3dGradTilingBlockParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 99 [Warning]: tiling struct [AvgPool3dGradTilingParam] is conflict with one in file avg_pool_3d_grad_tiling.h, line 125 [Warning]: tiling struct [FusedCrossEntropyLossWithMaxSumTilingData] is conflict with one in file fused_cross_entropy_loss_with_max_sum_tiling.h, line 27 [Warning]: tiling struct [TilingDataBackgroundReplace] is conflict with one in file background_replace_tiling.h, line 22 [Warning]: tiling struct [TilingDataBlendImages] is conflict with one in file blend_images_custom_tiling.h, line 24 Launch aclnnAdd successfully Synchronize stream successfully Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully! /example/0_quickstart/1_error_handling$ bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build/main Run the sample: ./build/main [INFO] ACL init and set device successfully [INFO] Current run mode: ACL_HOST [INFO] Triggering an expected invalid-parameter error with aclrtGetRunMode(nullptr) [ERROR] Diagnostics: ret=100000, peekErr=0, lastErr=0, recentErrMsg=[PID: 2238268] 2026-03-30-14:54:54.405.703 Invalid_Argument_Null_Pointer(EH0002): Argument [runMode] must not be null. Solution: Try again with a correct pointer argument. [WARN] aclrtGetErrorVerbose(0) returned error code 207000 [INFO] After diagnostics are consumed once: peekErr=207000, lastErr=207000, recentErrMsg=<null> [INFO] ACL finalize successfully ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> example/0_quickstart/1_error_handling/README.md example/1_basic_features/device/0_device_normal/README.md .... example/*/README.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1276 | 4 个月前 | |
infnan模式支持设置溢出检测开关 Co-authored-by: zhangxingxing_xx<zhangxingxing33@hisilicon.com> # message auto-generated for no-merge-commit merge: !2846 merge cherry-pick-mr-2763-1781531453572-auto into 9.1.0 infnan模式支持设置溢出检测开关 Created-by: zhangxinxing_xx Commit-by: zhangxingxing_xx Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 infnan模式支持设置溢出检测开关 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 本地验证 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [ ] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [ ] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [ ] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2846 | 1 个月前 | |
[Profiling]【fix】:补充aclprofStart不依赖aclprofStart资料,并在experiment目录下再次增加头文件的软链接 Co-authored-by: z00622916<zhengkai40@huawei.com> # message auto-generated for no-merge-commit merge: !2684 merge profiling-docs-update into master [Profiling]【fix】:补充aclprofStart不依赖aclprofStart资料,并在experiment目录下再次增加头文件的软链接 Created-by: z296249221 Commit-by: z00622916 Merged-by: cann-robot Description: # Pull Request ## 描述 请清晰准确地描述本次 Pull Request 的意图和变更内容。 1. 补充aclprofStart不依赖aclprofStart资料。 2. 在experiment目录下再次增加头文件的软链接。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> NA ## 如何测试 描述测试此变更的步骤和前提条件: NA ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2684 | 1 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
【PR】: 告警修改同步到商分 Co-authored-by: Reyn52166<leihuan1@huawei.com> # message auto-generated for no-merge-commit merge: !3043 merge 9.1.0 into 9.1.0 【PR】: 告警修改同步到商分 Created-by: Reyn52166 Commit-by: Reyn52166 Merged-by: cann-robot Description: # Pull Request ## 描述 告警修改同步到商分。主线合入链接: https://gitcode.com/cann/runtime/pull/3041 https://gitcode.com/cann/runtime/pull/3035 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> NA ## 如何测试 不涉及功能变更 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!3043 | 1 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
【PR】: fix: sample 易用性规范性优化 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !2067 merge master into master 【PR】: fix: sample 易用性规范性优化 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: # Pull Request ## 描述 1、sample样例 readme规范化 整改 2、sample样例 补充优化注释 3、sample样例 cmakelist 连接包优化,libascendcl.so -> libacl_rt.so 4、新增一键导入 SOC_VERSION和ASCENDC_CMAKE_DIR变量的工具 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. example/0_quickstart/4_custom_kernel_launch Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully with <<<>>> kernel call! 2. 样例执行验证 ===== START 0_quickstart/0_hello_cann ===== RESULT 0_quickstart/0_hello_cann rc=0 -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build/main Run the sample: ./build/main ACL init successfully Set device 0 successfully Create stream successfully Input vectors: self: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] other: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] alpha: 1.0 Create output aclDataBuffer successfully, buffer addr = 0x12e0c0016000 Get workspace size successfully, workspace size = 0 Launch aclnnAdd successfully Synchronize stream successfully Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully! ===== END 0_quickstart/0_hello_cann ===== ===== START 0_quickstart/1_error_handling ===== RESULT 0_quickstart/1_error_handling rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build/main Run the sample: ./build/main [INFO] ACL init and set device successfully [INFO] Current run mode: ACL_HOST [INFO] Triggering an expected invalid-parameter error with aclrtGetRunMode(nullptr) [ERROR] Diagnostics: ret=100000, peekErr=0, lastErr=0, recentErrMsg=[PID: 334883] 2026-05-12-16:34:08.984.159 Invalid_Argument_Null_Pointer(EH0002): Argument [runMode] must not be null. Solution: Try again with a correct pointer argument. [WARN] aclrtGetErrorVerbose(0) returned error code 207000 [INFO] After diagnostics are consumed once: peekErr=207000, lastErr=207000, recentErrMsg=<null> [INFO] ACL finalize successfully ===== END 0_quickstart/1_error_handling ===== ===== START 0_quickstart/2_system_info ===== RESULT 0_quickstart/2_system_info rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build/main Run the sample: ./build/main [INFO] ACL init successfully [INFO] ACL Runtime API version: 1.16.0 [INFO] CANN package [runtime] version string: 9.0.0 [INFO] CANN package [runtime] version number: 90000000 [INFO] Current run mode: ACL_HOST [INFO] Float conversion: 1.625000 -> 0x3e80 -> 1.625000 [INFO] Data type size: ACL_FLOAT=4, ACL_FLOAT16=2, ACL_INT64=8 [INFO] ACL finalize successfully ===== END 0_quickstart/2_system_info ===== ===== START 1_basic_features/device/0_device_normal ===== RESULT 1_basic_features/device/0_device_normal rc=0 [INFO]: Current compile soc version is ascend910_9362 -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/1_basic_features/device/0_device_normal/build [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main -- Install configuration: \"Debug\" [INFO] Start to run device_normal sample. [INFO] result[0] is: 1.200000 [INFO] result[1] is: 2.200000 [INFO] result[2] is: 3.200000 [INFO] result[3] is: 5.400000 [INFO] result[4] is: 6.400000 [INFO] result[5] is: 7.400000 [INFO] result[6] is: 9.600000 [INFO] result[7] is: 10.600000 [INFO] Run the device_normal sample successfully. ===== END 1_basic_features/device/0_device_normal ===== ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2067 | 2 个月前 | |
Initial commit | 7 个月前 | |
【PR】: fix: sample 易用性规范性优化 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !2067 merge master into master 【PR】: fix: sample 易用性规范性优化 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: # Pull Request ## 描述 1、sample样例 readme规范化 整改 2、sample样例 补充优化注释 3、sample样例 cmakelist 连接包优化,libascendcl.so -> libacl_rt.so 4、新增一键导入 SOC_VERSION和ASCENDC_CMAKE_DIR变量的工具 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [x] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. example/0_quickstart/4_custom_kernel_launch Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully with <<<>>> kernel call! 2. 样例执行验证 ===== START 0_quickstart/0_hello_cann ===== RESULT 0_quickstart/0_hello_cann rc=0 -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/0_hello_cann/build/main Run the sample: ./build/main ACL init successfully Set device 0 successfully Create stream successfully Input vectors: self: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] other: [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] alpha: 1.0 Create output aclDataBuffer successfully, buffer addr = 0x12e0c0016000 Get workspace size successfully, workspace size = 0 Launch aclnnAdd successfully Synchronize stream successfully Vector addition result: result[0] = 1.5 (expected: 1.5) result[1] = 3.0 (expected: 3.0) result[2] = 4.5 (expected: 4.5) result[3] = 6.0 (expected: 6.0) result[4] = 7.5 (expected: 7.5) result[5] = 9.0 (expected: 9.0) result[6] = 10.5 (expected: 10.5) result[7] = 12.0 (expected: 12.0) Free device memory successfully Destroy stream successfully Reset device successfully ACL finalize successfully Sample run successfully! ===== END 0_quickstart/0_hello_cann ===== ===== START 0_quickstart/1_error_handling ===== RESULT 0_quickstart/1_error_handling rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/1_error_handling/build/main Run the sample: ./build/main [INFO] ACL init and set device successfully [INFO] Current run mode: ACL_HOST [INFO] Triggering an expected invalid-parameter error with aclrtGetRunMode(nullptr) [ERROR] Diagnostics: ret=100000, peekErr=0, lastErr=0, recentErrMsg=[PID: 334883] 2026-05-12-16:34:08.984.159 Invalid_Argument_Null_Pointer(EH0002): Argument [runMode] must not be null. Solution: Try again with a correct pointer argument. [WARN] aclrtGetErrorVerbose(0) returned error code 207000 [INFO] After diagnostics are consumed once: peekErr=207000, lastErr=207000, recentErrMsg=<null> [INFO] ACL finalize successfully ===== END 0_quickstart/1_error_handling ===== ===== START 0_quickstart/2_system_info ===== RESULT 0_quickstart/2_system_info rc=0 Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/0_quickstart/2_system_info/build/main Run the sample: ./build/main [INFO] ACL init successfully [INFO] ACL Runtime API version: 1.16.0 [INFO] CANN package [runtime] version string: 9.0.0 [INFO] CANN package [runtime] version number: 90000000 [INFO] Current run mode: ACL_HOST [INFO] Float conversion: 1.625000 -> 0x3e80 -> 1.625000 [INFO] Data type size: ACL_FLOAT=4, ACL_FLOAT16=2, ACL_INT64=8 [INFO] ACL finalize successfully ===== END 0_quickstart/2_system_info ===== ===== START 1_basic_features/device/0_device_normal ===== RESULT 1_basic_features/device/0_device_normal rc=0 [INFO]: Current compile soc version is ascend910_9362 -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/1_basic_features/device/0_device_normal/build [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main -- Install configuration: \"Debug\" [INFO] Start to run device_normal sample. [INFO] result[0] is: 1.200000 [INFO] result[1] is: 2.200000 [INFO] result[2] is: 3.200000 [INFO] result[3] is: 5.400000 [INFO] result[4] is: 6.400000 [INFO] result[5] is: 7.400000 [INFO] result[6] is: 9.600000 [INFO] result[7] is: 10.600000 [INFO] Run the device_normal sample successfully. ===== END 1_basic_features/device/0_device_normal ===== ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2067 | 2 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 | |
【PR】: example/set_sample_env.sh codecheck 优化 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !2673 merge codecheck into master 【PR】: example/set_sample_env.sh codecheck 优化 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: # Pull Request ## 描述 为 example/set_sample_env.sh 增加 Bash 严格模式: - 在脚本入口添加 set -euo pipefail,提升脚本执行失败时的可感知性。 - 兼容 set -u:对 ASCEND_INSTALL_PATH、ASCEND_HOME_PATH 等可选环境变量使用默认空值判断。 - 兼容 set -e:将命令执行失败后的 $? 判断调整为 if ! ...; then 形式,避免脚本提前退出导致错误信息丢失。 - 对 source 场景保存并恢复调用方原有 shell 选项,避免严格模式污染用户当前 shell 环境。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [x] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> NA ## 如何测试 描述测试此变更的步骤和前提条件: bash example/set_sample_env.sh SOC_VERSION=Ascend910_9362 ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann-9.0.0/aarch64-linux/tikcpp/ascendc_kernel_cmake [INFO]: To export variables in current shell, run: source example/set_sample_env.sh  1_basic_features/device/0_device_normal$ bash run.sh [INFO] Start to run device_normal sample. [INFO] result[0] is: 1.200000 [INFO] result[1] is: 2.200000 [INFO] result[2] is: 3.200000 [INFO] result[3] is: 5.400000 [INFO] result[4] is: 6.400000 [INFO] result[5] is: 7.400000 [INFO] result[6] is: 9.600000 [INFO] result[7] is: 10.600000 [INFO] Run the device_normal sample successfully. ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/runtime!2673 | 1 个月前 | |
优化example目录结构易用性及补充用例 Co-authored-by: qiang_zq<qiang.zhangqiang@huawei.com> # message auto-generated for no-merge-commit merge: !1163 merge sample into master 优化example目录结构易用性及补充用例 Created-by: qiang_zq Commit-by: qiang_zq Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1、example 目录结构优化,按学习阶段重新组织目录结构(0_quickstart ~ 6_scenarios) 2、补充部分API的example用例 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/runtime/issues/284 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 部分用例执行过程 source /home/developer/Ascend/cann/set_env.sh && export SOC_VERSION=ascend910b3 && export ASCENDC_CMAKE_DIR=/home/developer/Ascend/cann/aarch64-linux/tikcpp/ascendc_kernel_cmake && export ASCEND_INSTALL_PATH=/home/developer/Ascend/cann && cd /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator && rm -rf build && dos2unix run.sh 2>/dev/null || sed -i 's/\\r$//' run.sh && bash run.sh Configuring CMake... -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build Building... [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o [100%] Linking CXX executable main [100%] Built target main Build completed successfully! Executable location: /mnt/workspace/gitCode/qiang_zq/runtime/example/3_memory_advanced/allocator/0_custom_allocator/build/main Run the sample: ./build/main ./build/main [INFO] CustomAlloc size=256 [INFO] CustomAllocAdvise size=128 [INFO] CustomAlloc size=128 [INFO] CustomFree invoked [INFO] CustomFree invoked [INFO] Allocator desc queried: descOut=0xaaaabd6a3780 allocCount=2 freeCount=2 用例执行报告 0_quickstart (3/3) ✅ ✅ 0_hello_cann ✅ 1_error_handling ✅ 2_system_info 1_basic_features (23/23) ✅ ✅ device/0_device_normal ✅ device/1_device_multi_thread ✅ device/2_device_P2P ✅ event/0_event_status ✅ event/1_event_timestamp ✅ memory/0_h2h_memory_copy ✅ memory/10_ipc_memory_withpid ✅ memory/11_ipc_memory_withoutpid ✅ memory/1_h2d_sync_memory_copy ✅ memory/2_h2d_async_memory_copy ✅ memory/3_d2h_sync_memory_copy ✅ memory/4_d2h_async_memory_copy ✅ memory/5_d2d_sync_memory_copy ✅ memory/6_d2d_async_memory_copy ✅ memory/7_physical_memory_sharing_withpid ✅ memory/8_physical_memory_sharing_withoutpid ✅ memory/9_multistream_sync_memory ✅ stream/0_simple_stream ✅ stream/1_stream_with_failure_mode ✅ stream/2_multi_stream 2_advanced_features (17/17) ✅ ✅ built_in_task/0_reduce_task ✅ built_in_task/1_random_num_task ✅ callback/0_simple_callback ✅ callback/1_callback_hostfunc ✅ callback/2_callback_exception ✅ group/0_compute_group ✅ kernel/0_launch_kernel ✅ kernel/1_launch_kernel_with_reslimit ✅ label/0_simple_label ✅ model_ri/0_simple_model ✅ model_ri/1_model_update ✅ model_ri/2_model_switch ✅ notify/0_ipc_notify_withpid ✅ notify/1_ipc_notify_withoutpid ✅ notify/2_cntnotify ✅ tdt_buffer/0_shared_buffer ✅ tdt_channel/0_simple_channel ✅ tdt_channel/1_channel_capacity ✅ tdt_queue/0_simple_queue ✅ tdt_queue/1_queue_route ✅ tdt_queue/2_queue_grant_attach 3_memory_advanced (1/1) ✅ ✅ allocator/0_custom_allocator 4_reliability (2/2) ✅ ✅ overflow_detection/0_overflow_detection ✅ snapshot/0_snapshot_management 5_performance (6/6) ✅ ✅ adump/0_adump_args ✅ adump/1_adump_callback ✅ adump/2_model_dump_config ✅ profiling/0_create_config ✅ profiling/1_msproftx ✅ profiling/2_subscribe_model ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> docs/02_dev_guide/初始化.md example/*.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/runtime!1163 | 4 个月前 |
样例使用指导
example目录下提供了一系列Runtime接口样例,包括Device管理、Stream管理、Event管理、内存管理、Kernel执行等,供开发者参考,帮助开发者快速入门,进而掌握Runtime关键特性。
目录总览
- 0_quickstart:快速入门样例,以
aclnnAdd向量加法为入口,展示 初始化配置、Device/Stream 创建、Tensor 与 DataBuffer 管理、workspace 分配、算子执行、同步等待和资源释放流程。 - 1_basic_features:基础特性样例,包含设备管理(包括单线程、多线程)、 内存管理(包括内存复制、进程间内存共享、虚拟内存管理等)、Stream管理(包括单流任务下发、多流任务下发等)等样例。
- 2_advanced_features:高级特性样例,包括算子Kernel加载与执行、ACL Graph、Reduce和随机数生成的内置系统任务执行、Host侧回调函数下发等样例。
- 3_memory_advanced:高级内存管理样例,包括自定义内存分配器、Host内存注册、统一寻址、Stream内存操作、Stream有序内存分配等样例。
- 4_reliability:可靠性样例,包括溢出检测、错误恢复等样例。
- 5_performance:性能分析与精度调试样例。
- 6_scenarios:场景化样例,面向训练流水线、多设备推理和容错执行等典型场景。
环境准备
编译运行样例前,需获取固件、驱动及CANN软件包并安装,详细步骤请参见《CANN软件安装指南》。
若对本仓src目录下的源码有定制,那么在安装CANN软件之后,还需编译源码并部署到环境上,具体操作请参见README。
运行样例
1.下载样例代码并上传至安装CANN软件的环境,切换到样例目录。
# 此处以基础内存样例为例
cd ${git_clone_path}/example/1_basic_features/memory/0_h2h_memory_copy
2.设置环境变量。
# ${install_root} 替换为 CANN 安装根目录,默认安装在`/usr/local/Ascend`目录
source ${install_root}/cann/set_env.sh
export ASCEND_INSTALL_PATH=${install_root}/cann
3.执行以下命令运行样例。
# 请注意部分用例的运行命令不同,具体以各用例目录下的README.md中的编译运行命令为准
bash run.sh
样例代码说明
所有样例演示了CANN Runtime API 的典型使用方式。
- 样例代码用于学习和接口理解。
- 为了突出核心流程,部分示例会简化工程化处理。
- 用于生产环境前,请补充完整的错误处理、资源管理和边界检查。