课程地址
第一章 Ascend C(旧名TIK C++)算子开发入门
https://www.hiascend.com/zh/developer/courses/detail/1627494761683783682
课程视频
https://space.bilibili.com/1190614918/channel/collectiondetail?sid=1201995
TIK2文档
https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/63RC1alpha002/operatordevelopment/tik2opdevg/atlastik2_10_0001.html
在线实验>基于昇腾CANN的TIK C++算子开发
https://www.hiascend.com/zh/edu/experiment/detail/Tik_xl
示例代码
https://gitee.com/zgx950813/samples/blob/master/tik2_demo/kernel_samples/hello_world.cpp
3.2核函数概念
核函数有2个限定符,具体说明如下
extern "C" __global__ __aicore__ void HelloWorld(__gm__ uint8_t* foo) {}
输入参数可统一使用__gm__ uint8_t类型,然后在函数体内再转化为实际的类型
核函数调用的3个参数,实际使用2个blockDim和Stream
使用宏__CCE_KT_TEST__来区分是在CPU模式或NPU模式下运行算子
样例代码详解
接口介绍