msOpGen工具根据用户需要,对简易的AscendC算子工程进行了适配。
单击Lin获取样例工程,为创建简易算子工程做准备。
git clone https://gitee.com/ascend/samples.git -b v1.3-8.2.RC1.alpha001
1 2 3 4 5 6 7 8 9 10 | ├── build.sh // 编译入口脚本 ├── cmake // 编译文件目录 ├── CMakeLists.txt // 算子工程的CMakeLists.txt ├── op_host // host侧实现文件 │ ├── add_custom_tiling.h // 算子tiling定义文件 │ ├── add_custom.cpp // 算子原型注册、shape推导、信息库、tiling实现等内容文件 │ ├── CMakeLists.txt ├── op_kernel // kernel侧实现文件 │ ├── CMakeLists.txt │ ├── add_custom.cpp // 算子代码实现文件 |
./build.sh
编译成功后,会在当前目录下创建build_out目录。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ├── CMakeFiles ├── autogen // 编译自动生成,包含算子信息库文件、单算子API调用头文件以及cpp实现等 ├── Makefile ├── install_manifest.txt ├── CMakeCache.txt // cmake相关均为简易算子工程编译过程中生成,无需关注 ├── CMake_install.cmake ├── op_api // 简易算子工程编译时生成,调用时需手动链接 │ ├── include │ ├── lib ├── op_host // host侧编译时生成 │ ├── CMakefiles │ ├── cmake_install.cmake │ ├── libcust_opapi.so │ ├── libcust_opmaster_rt2.0.so │ ├── Makefile ├── op_kernel // kernel侧编译时生成 │ ├── CMakefiles │ ├── cmake_install.cmake // 算子二进制.o、静态库等 │ ├── kernel │ ├── Makefile |