文件最后提交记录最后更新时间
4 个月前
4 个月前
1 个月前
2 个月前
4 个月前
4 个月前
4 个月前
2 个月前
4 个月前
16 天前
22 天前
30 天前
16 天前
README

CANN Interface Components

This directory contains all components related to the Compute Architecture for Neural Networks (CANN) interface for the perf-reference-ascend project.

Directory Structure

All files are organized in a flat directory structure:

canninterface/
├── nda_op.c                    # NDA操作基础实现
├── nda_op.h                    # NDA操作数据结构定义
├── nda_op_api.h                # NDA操作API声明(op_test函数声明)
├── nda_op_func.c               # NDA操作API实现(op_test函数实现)
├── acl_memory.c                # ACL内存管理实现
├── acl_memory.h                # ACL内存管理接口声明
├── aclnn_nda_test_bw.h         # ACL NN NDA测试相关定义
├── acl_wrapper_basic.h         # ACL基础接口封装声明
├── acl_wrapper_basic.cpp       # ACL基础接口封装实现
├── acl_wrapper_basic_example.c # ACL封装使用示例
└── cann_interface.h            # CANN接口总入口头文件

Components Overview

NDA Operator

Contains the implementation for NDA operators used in performance testing:

The op_test function provides a C-callable interface for executing NDA benchmark kernels.

ACL Memory Management

Contains memory management functions for ACL operations:

ACL Wrapper

Contains wrapper implementations for ACL interfaces:

These wrappers allow C code to call ACL (Ascend Computing Library) functions through a C-compatible interface.

Design Principles

  1. 接口分离: 声明与实现分离,便于维护和扩展
  2. 封装隔离: 通过wrapper层隐藏CANN接口的复杂性
  3. 模块化: 扁平化目录结构,所有相关文件在同一层级
  4. C/C++混合编译: 支持C代码调用C++实现的ACL功能

Main Interface

  • cann_interface.h - Main entry point header file that includes all CANN-related interfaces

Usage

  • Upper-level C code calls all CANN-related functionality by including canninterface/cann_interface.h
  • Lower-level implementations access ACL interfaces through various wrapper files
  • During compilation, link with both the C++ standard library and ACL runtime libraries

Build Notes

  • NDA operator functions are compiled as C++ code, with the public interface exposed as C functions
  • ACL wrappers provide C-compatible interfaces to ACL functions
  • The flat directory structure simplifies file organization and access
  • Use #include "canninterface/cann_interface.h" to access all CANN-related functionality