打开微信,使用扫一扫进入页面后,点击右上角菜单,
点击“发送给朋友”或“分享到朋友圈”完成分享
g++ main.cpp -lcnrt -std=c++11 -o main
当进行g++编译时报错:
/tmp/main-qutmEd.o: In function `main':
main.cpp:(.text+0x11a): undefined reference to `kernel'
cncc: error: er command failed with exit code 1 (use -v to see invocation)
cncc main.cpp kernel.mlu -o main
进行cncc编译时报错:
In file included from main.cpp:1:
In file included from /usr/local/neuware/lib/clang/5.0.1/include/bang_wrappers/stdio.h:30:
/usr/local/neuware/lib/clang/5.0.1/include/bang_device_types.h:29:2: error: "This file is for BANG compilation only."
#error "This file is for BANG compilation only."
^
/usr/local/neuware/lib/clang/5.0.1/include/bang_device_types.h:157:51: error: use of undeclared identifier 'half'
typedef __attribute__((__vector_size__(2 * sizeof(half)), aligned(1024))) half v2f16;
^
/usr/local/neuware/lib/clang/5.0.1/include/bang_device_types.h:157:75: error: unknown type name 'half'
typedef __attribute__((__vector_size__(2 * sizeof(half)), aligned(1024))) half v2f16;
^
/usr/local/neuware/lib/clang/5.0.1/include/bang_device_types.h:158:51: error: use of undeclared identifier 'half'
typedef __attribute__((__vector_size__(2 * sizeof(half)), aligned(1024))) half v1f16;
^
/usr/local/neuware/lib/clang/5.0.1/include/bang_device_types.h:158:75: error: unknown type name 'half'
typedef __attribute__((__vector_size__(2 * sizeof(half)), aligned(1024))) half v1f16;
^
In file included from main.cpp:1:
/usr/local/neuware/lib/clang/5.0.1/include/bang_wrappers/stdio.h:37:36: error: conflicting types for 'vprintf'
__mlu_device__ __mlu_builtin__ int vprintf(const char *, const char *);
^
/usr/include/stdio.h:333:12: note: previous declaration is here
extern int vprintf (const char *__restrict __format, _G_va_list __arg);
^
In file included from main.cpp:2:
/usr/local/neuware/lib/clang/5.0.1/include/bang_wrappers/stdlib.h:49:10: error: use of undeclared identifier '__mlvm_scalar_abs_s32'
return __mlvm_scalar_abs_s32(__x);
^
/usr/local/neuware/lib/clang/5.0.1/include/bang_wrappers/stdlib.h:52:10: error: use of undeclared identifier '__mlvm_scalar_abs_s16'
return __mlvm_scalar_abs_s16(__x);
^
8 errors generated.
是我编译的命令不对还是编译步骤不对,我该怎么去编译main.cpp
热门帖子
精华帖子