CANN/asc-devkit:Ascend C开发套件
【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkitAscend CMulti-level API built on C/C, providing complete chip programming capabilities for极致performanceLatest News[2026/03] v9.0.0-beta.2 Key Features Key FeaturesAscend 950PR supports SIMD programming mode, providing 200 API interfaces with cross-generation compatibility, enabling smooth operator migration from Atlas A2 series and Atlas A3 series products.Ascend 950PR adds Reg-based programming, providing 90 Reg programming interfaces including Reg data movement, basic arithmetic, reduction computation, and synchronization control.Atlas A2 series, Atlas A3 series, and Ascend 950PR support language extension layer pure C interfaces, providing array-style memory allocation and pointer-based computation interfaces for native pure C programming experience.Ascend 950PR supports SIMD and SIMT hybrid programming, providing approximately 700 SIMT API interfaces, including warp, atomic, basic mathematical computation, type conversion, and other fundamental interfaces.Ascend 950PR supports communication high-level API CCU communication interfaces, providing Allreduce, Allgather, Reducescatter, AlltoAll and other mainstream communication primitives based on CCU; Matmul high-level API adds support for MXFP4/8 low-bit data type matrix operations, achieving half memory usage and doubled computing throughput.Ascend 950PR adds and compatibly supports approximately 260 samples, including SIMT samples, SIMD samples (framework, basic API, high-level API, best practices, and so on), and sample directory structure adjustments to improve readability.Fusion compilation and invocation support CPU mode and SIM simulation mode. DocumentationAdded 90 Reg programming interface API documentation. Reg vector computation API is developed for RegBase architecture, allowing users to directly operate registers involved in Vector computation on the chip for greater flexibility and better performance.Added SIMT quick start, programming model, and operator implementation introductions.Added SIMD and SIMT hybrid programming model, operator implementation, and performance optimization introductions.Added SIMT API documentation section.Added compatibility migration guide (220x architecture version migration to 351x architecture version).In Ascend community, Ascend C operator development added visualization zone, presenting Cube and Vector operator execution processes through videos.For detailed information about all historical versions and updates, see CHANGELOG.md OverviewAscend C is a dedicated operator program development language for Ascend AI processors launched by CANN (Compute Architecture for Neural Networks), with native support for C and C standard specifications. As a programming language designed for multiple scenarios, Ascend C not only aims toprovide complete chip programming capabilities for ultimate performance, but also enables flexible selection of the most suitable API based on project requirements, team skills, and performance goals through multi-level programming API design, achieving the best balance between development efficiency and runtime performance.Design GoalsAscend Cs design goals can be summarized ashigh performance, completeness, ease of programming, debuggability, and compatibility. Through minimal extensions to C/C language standards, it supports both pointer-based C language development habits and Tensor-based C programming paradigm, seamlessly integrating with existing ecosystems while supporting efficient Ascend operator development and ensuring consistent development experience.We adhere to the following core principles:No silver bullet: Different scenarios have varying requirements for performance and development efficiency; a single interface cannot optimally adapt to all scenarios;Progressive learning: Beginners can start with ease-of-use interfaces for quick algorithm verification; experts can drill down for fine-tuning, leveraging complex interface features to fully exploit hardware potential.API LevelsAscend C provides three types of interfaces, all achieving complete low-level programming capabilities:API LevelLanguageFeaturesTarget UsersMain UsesTpipe/Tque Framework Programming APICTensor-based programmingUnified memory and synchronization management through Tpipe/Tque frameworkOperator library developersFramework-based automatic synchronization and memory management for improved programming usabilityBasic APICTensor-based programming, providingC basic complete programming capabilitiesTensor allocation through MakeTensor/LocalMemoryAllocator, self-managed synchronizationOperator library developersSelf-managed synchronization and memoryMatching C Tensor development habits for ultimate performanceLanguage Extension LayerSIMDSIMT APICPointer-based programming, providingC basic complete programming capabilitiesMemory allocation through array [], self-managed synchronizationOperator library developersSelf-managed synchronization and memoryMatching C language development habits for ultimate performanceIn addition, Ascend C provides high-level API and operator template library to improve operator development efficiency.API LevelTarget UsersMain UsesOperator Template Library (CATLASS/ATVOSS and so on)Algorithm developersCustom extensions based on typical operator implementations for specific scenario high-performance requirementsHigh-level APIAlgorithm developersReusing common single-core algorithms for quick algorithm verificationThe overall logical architecture diagram is shown below:Language Extension Layer C API: Pure C interfaces, supporting array memory allocation and pointer-based computation interfaces, providing industry-consistent C language programming experience and complete chip programming capabilities. Atlas A2/A3 supports SIMD pure C interfaces; Ascend 950PR/Ascend 950DT will support industry-similar SIMT programming capabilities and SIMD/SIMT hybrid programming capabilities;Basic API: Single-instruction abstracted C class library API, generally Tensor-based programming; gradually improving Tensor programming capabilities based on Layout;High-level API: Abstraction and encapsulation based on single-core for common algorithms, providing implementations of public algorithms;Operator Template Library: Complete implementation references for operators based on templates, simplifying Tiling development, supporting user-defined extensions;Python Frontend PyAsc: PyAsc provides complete low-level chip programming capabilities based on Python frontend, and will gradually improve Tensor programming capabilities based on Layout, adding SIMT programming and other capabilities for developing high-performance operators based on Python interfaces;How to Choose Multi-level API for Operator DevelopmentC/C language-based development: See Ascend C Multi-level API Selection Guide for detailsPython language-based development, supporting complete programming capabilities for ultimate performance: Recommend Ascend C Python frontend PyAscPython language-based development, quick development verification, ease of use priority: Recommend PyPTO Directory StructureThis repository mainly contains Ascend C programming API and necessary cmake build scripts, which are core modules required for operator development. The directory structure is as follows:├── cmake # Ascend C build source code ├── docs # Project documentation introduction ├── examples # Ascend C API sample projects ├── impl # Ascend C API implementation source code │ ├── adv_api # Ascend C high-level API implementation source code │ ├── aicpu_api # Ascend C AI CPU API implementation source code │ ├── basic_api # Ascend C basic API implementation source code │ ├── c_api # Ascend C language extension layer C API implementation source code │ ├── experimental # Ascend C TENSOR API implementation source code │ ├── simt_api # Ascend C SIMT API implementation source code │ └── utils # Ascend C utility class implementation source code ├── include # Ascend C API declaration source code │ ├── adv_api # Ascend C high-level API declaration source code │ ├── aicpu_api # Ascend C AI CPU API declaration source code │ ├── basic_api # Ascend C basic API declaration source code │ ├── c_api # Ascend C language extension layer C API declaration source code │ ├── experimental # Ascend C TENSOR API declaration source code │ ├── simt_api # Ascend C SIMT API declaration source code │ └── utils # Ascend C utility class declaration source code ├── scripts # Packaging related scripts ├── tests # Ascend C API UT cases └── tools # Ascend C tool source code⚡️ Quick StartTo quickly experience project build and operator sample execution, access the following documentation for simple tutorials.Build and Compilation: Introduces environment setup, build execution, local verification, and other operations.Sample Execution: Provides operator development samples and introduces end-to-end sample execution methods. clangd/IDE SupportInstall clangd (recommended 15, Ubuntu OS example) and VSCode plugin clangdsudo apt install -y clangd-15Configure local VSCodesettings.json(example){ clangd.path: /usr/bin/clangd, clangd.arguments: [ --background-index0, --clang-tidy0 ], C_Cpp.intelliSenseEngine: disabled }Configure.clangdin project root directory (example) Complete.clangdfile is provided in this directory, where CANN header file directory needs to be replaced with actual installation location, default is/usr/local/Ascendin.clangd.CompileFlags: Add: - -stdc17 - -stdliblibstdc - -D__NPU_ARCH__2201 - -DASCENDC_CPU_DEBUG1 ... --- If: PathMatch: .*\\.(asc|aicpu)$ CompileFlags: CompilationDatabase: None Add: - -x - c Diagnostics: Suppress: - attributes_not_allowed - decomp_decl_template - ignored_attributes - unknown_type_name - undeclared_var_use - invalid_token_after_toplevel_declarator - missing_type_specifier - typename_nested_not_found - redefinitionRestart clangd (VSCode: Command Palette - Clangd: Restart language server) For any suggestions or improvements regarding ASC language syntax highlighting and code navigation support, community developers are welcome to provide feedback! Related ResourcesProgramming Guide| Document | Description | |---------|--------| |Ascend C Programming Guide|Write operator programs using Ascend C based on Ascend AI hardware, develop custom operators.| |Ascend C Practice Reference | Introduces how to further optimize operator performance based on already developed Ascend C operators. | |Ascend C API List| Ascend C SIMDSIMT API, including language extension layer C API, C class library basic API and high-level API| |Ascend C Samples| Ascend C API key feature introduction samples, including AICore SIMDSIMT, AICPU, and so on| |Ascend C Programming Guide (Harmony)|Write operator programs using Ascend C based on Kylin AI hardware, develop custom operators.|Contribution Guide| Document | Description | |---------|--------| |CANN Community Contribution Guide| CANN community Issue, PR and other general processing procedures| |ASC-DevKit Contribution Guide | Ascend C API, documentation and samples contribution guide|Others| Document | Description | |---------|--------| |Ascend C Meetup Materials|Ascend C external presentation PPT materials, including 950 new features, and so on| |Ascend C Wiki|Ascend C technical promotion articles, and so on| |CANN-Learning-Hub|Ascend C operator development online full-process tutorial| |Ascend C Ops Samples|Ascend C operator how to gradually achieve high-performance sample repository| Related PlansAscend C Development Roadmap (2026 Q2); Related InformationContribution GuideSecurity StatementLicense【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考