git clone https://gitee.com/ascend/samples.git -b v1.0-8.1.RC1.alpha001
cd ${git_clone_path}/samples/operator/ascendc/0_introduction/1_add_frameworklaunch
bash install.sh -v Ascendxxxyy # xxxyy为用户实际使用的具体芯片类型
1 2 3 4 5 | "cacheVariables": { "CMAKE_BUILD_TYPE": { "type": "STRING", "value": "Debug" }, |
cd ${git_clone_path}/samples/operator/ascendc/0_introduction/1_add_frameworklaunch/AclNNInvocation
将自定义算子工程编译后输出在build_out目录下Kernel侧的.o文件路径导入环境变量。
export LAUNCH_KERNEL_PATH=/{path_to_kernel}/kernel_name.o //{path_to_kernel}表示对算子kernel侧实现编译后生成的算子二进制文件*.o所在路径,请根据实际情况进行替换
export LD_LIBRARY_PATH=$ASCEND_HOME_PATH/opp/vendors/customize/op_api/lib:$LD_LIBRARY_PATH cd AclNNInvocation/output msdebug execute_add_op (msdebug) target create "execute_add_op" Current executable set to '/home/AclNNInvocation/output/execute_add_op' (aarch64). (msdebug)
b add_custom.cpp:55
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | (msdebug) r Process 1385976 launched: '$home/shelltest/test/samples/operator/ascendc/0_introduction/1_add_frameworklaunch/AclNNInvocationNaive/build/execute_add_op' (aarch64) [Launch of Kernel anonymous on Device 0] Process 1385976 stopped [Switching to focus on Kernel anonymous, CoreId 24, Type aiv] * thread #1, name = 'execute_add_op', stop reason = breakpoint 1.1 frame #0: 0x0000000000001564 AddCustom_1e04ee05ab491cc5ae9c3d5c9ee8950b.o`KernelAdd::Compute(this=0x000000000028f8a8, progress=0) (.vector) at add_custom.cpp:55:19 52 LocalTensor<DTYPE_Y> yLocal = inQueueY.DeQue<DTYPE_Y>(); 53 LocalTensor<DTYPE_Z> zLocal = outQueueZ.AllocTensor<DTYPE_Z>(); 54 Add(zLocal, xLocal, yLocal, this->tileLength); -> 55 outQueueZ.EnQue<DTYPE_Z>(zLocal); 56 inQueueX.FreeTensor(xLocal); 57 inQueueY.FreeTensor(yLocal); 58 } (msdebug) |