quick_sort无法通过编译[代码]
您好,生成的-o文件需要进行再编译,以得到可调式程序,您可以参考:CNGDB 安装 — 寒武纪CNGDB用户手册 v1.14.0 文档 (cambricon.com)展开
quick_sort无法通过编译
root@localhost:/home/samples/usrSamples/sort# cncc recursion.mlu -o recursion.o -g -O0 --bang-mlu-arch=MLU270 --bang-device-only root@localhost:/home/samples/usrSamples/sort# g++ recursion.o main.cpp -o quick_sort -lcnrt -I/usr/local/neuware/include/ -L/usr/local/neuware/lib64 /tmp/ccksbGG3.o: In function `main': main.cpp:(.text+0x507): undefined reference to `kernel' collect2: error: ld returned 1 exit status
您好,生成的-o文件需要进行再编译,以得到可调式程序,您可以参考:CNGDB 安装 — 寒武纪CNGDB用户手册 v1.14.0 文档 (cambricon.com)展开
你好,我按照上面的示例,可以编译,使用cngdb还是不行
root@localhost:/home/samples/usrSamples/sort# cncc kernel.mlu -o kernel.o -g -O0 --bang-mlu-arch=MLU270 --bang-device-only root@localhost:/home/samples/usrSamples/sort# g++ kernel.o main.cpp -o multicore -lcnrt -lcnrt -I /usr/local/neuware/include/ -L /usr/local/neuware/lib64/ root@localhost:/home/samples/usrSamples/sort# cngdb ./multicore CNGDB v1.14.0 Internal Edition (based on GNU gdb 7.11.1) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./multicore...done. (cn-gdb) b kernel.mlu :6 if i==0 Breakpoint 1 at 0x7eb: file kernel.mlu, line 6. (cn-gdb) r Starting program: /home/samples/usrSamples/sort/multicore [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". CNRT: 4.10.1 a884a9a Union Type: CNRT_FUNC_TYPE_UNION1 [Switch from logical device 0 cluster 0 core 0 to logical device 0 cluster 0 core 1.] [Switch from logical device 0 cluster 0 core 1 to logical device 0 cluster 0 core 2.] [Switch from logical device 0 cluster 0 core 2 to logical device 0 cluster 0 core 3.] [Switch from logical device 0 cluster 0 core 3 to logical device 0 cluster 0 core 4.] [Switch from logical device 0 cluster 0 core 4 to logical device 0 cluster 0 core 0.] [Switch from logical device 0 cluster 0 core 0 to logical device 0 cluster 0 core 1.] [Switch from logical device 0 cluster 0 core 1 to logical device 0 cluster 0 core 2.] [Switch from logical device 0 cluster 0 core 2 to logical device 0 cluster 0 core 3.] [Switch from logical device 0 cluster 0 core 3 to logical device 0 cluster 0 core 0.] [Switch from logical device 0 cluster 0 core 0 to logical device 0 cluster 0 core 1.] [Switch from logical device 0 cluster 0 core 1 to logical device 0 cluster 0 core 2.] [Switch from logical device 0 cluster 0 core 2 to logical device 0 cluster 0 core 4.] 2 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 FAILED [Inferior 1 (process 1925) exited normally] (cn-gdb)
[图片]mat.zip 代码编译命令`cncc matrixmul.mlu -o mat -g -O0 --bang-mlu-arch=MLU270`进行调试命令为`cngdb ./mat`进入cngdb后执行`b main`,`r`,`cngdb breakpoints on`,`b 47`,`r`程序直接结束,没有在设备端代码的47停留展开
您好,mat.zip中的文件内容为空,请您检查下上传文件中内容的完整性。
抱歉,我重新传了下。这个就是安装包samples`/samples/BANG/bang-c/matrixmul`中matrixmul.mlu文件
请登录后评论