This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 编译器/TMDXIDK57X-LCD:OpenCL 编译问题

Guru**** 666710 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/844035/compiler-tmdxidk57x-lcd-opencl-compile-issue

器件型号:TMDXIDK57X-LCD

工具/软件:TI C/C++编译器

大家好、

我正在尝试编译这里的 ti 示例 、但它给出了以下错误:

root@am57xx-EVM:~ g++-O3 -std=c++11 matmul_ocl.cpp -lOpenCL -locl_util -o matmpy
、包含在/usr/include/ocl_util.h:37:0中、
从 matmul_OCL.CPP:5:
/usr/include/CL/cl.hpp



/usr/include/CL/cl.hpp


/usr/include/CL/cl.hpp:945:1:错误:程序中的"`"_ param_name_info_1_0 (_声明_参数_
参数_参数_参数_参数);^/usr/include/CL/cl.hpp:945:1:错误:程序中的"杂散'`^
^:4021:0:错误:未终止参数列表
调用 CL_macros___enmaterie_param_params:_enmateries/params:14:
/usr/include/ocl_util.h:inquality_param_params:16:1:inquality_param_param_enches/params:16_param_enchs_: 命名空间'cl'中的'event'不会将类型
命名为 void OCL_event_times (const cl::Event &EV、const char* name);
^
/usr/include/ocl_util.h:42:36:错误:命名空间'cl'中的'event'不会将类型
命名为 void OCL_relational_times (const cl::Event &EV、const char* name、cl_ulong 引用);
^
matmul_ocl.cpp:在函数'void cl:::detail:::mat_mpy_ocl (float*、float*、float*、int、int、int、 int、std:::size_t)':
matmul_ocl.cpp:49:33:错误:变量'cl:上下文'具有初始化程序、但类型不完整
背景 上下文(CL_DEVICE_TYPE_Accelerator);
^
matmul_ocl.cpp:50:72:错误:")"令牌之前的预期主表达式
std::向量 设备= context.getinfo ();
^
matmul_OCL.CPP:51:29:错误:变量'cl:CommandQueue Q'具有初始化程序、但类型不完整
CommandQueue q (上下文、设备[0]);
^
matmul_ocl.cpp:54:6:错误:嵌套名称说明符中使用的不完整类型'cl:Program'
程序::源(1、std:::make_pair (kernelSrc.c_str()、
^
matmul_ocl.cpp:56:26:错误:变量'cl:Program P'具有初始化程序、但类型不完整
程序 P =程序(上下文、来源);
^
matmul_ocl.cpp:56:47:错误:未在此范围内声明'source'
程序 P =程序(上下文、来源);
^
matmul_ocl.cpp:56:53:错误:不完整类型'class cl:Program'的无效使用
程序 P =程序(上下文、来源);
^
包含在/usr/include/ocl_util.h:37:0中、
从 matmul_ocl.cpp:5:
/usr/include/CL/cl.hpp:201:7:注意:'class cl: Program'
class Program'的正向声明;
^
matmul_ocl.cpp:60:6:错误:未在此范围内声明'buffer'
缓冲区 bufA (context、CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR、MAT_SIZE、A);
^
matmul_ocl.cpp:61:13:错误:'bufB'前的预期';'
缓冲区 bufB (context、CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR、MAT_SIZE、B);
^
matmul_ocl.cpp:62:13:错误:'bufC'前的预期';'
缓冲器 bufC (context、CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR、MAT_SIZE、C);
^
matmul_ocl.cpp:65:6:错误:未在此范围内声明'kernel'
内核 K (P、"OCL_matmpy");
^
matmul_ocl.cpp:66:6:错误:没有在此范围内声明"K"
K.setArg(0、bufA);
^
matmul_ocl.cpp:66:18:错误:'bufA'未在此范围内声明
K.setArg(0、bufA);
^
matmul_ocl.cpp:67:18:错误:'bufB'未在此范围内声明
K.setArg(1、bufB);
^
matmul_ocl.cpp:68:18:错误:'bufC'未在此范围内声明
K.setArg(2、bufC);
^
matmul_ocl.cpp:73:6:错误:'event'未在此范围内声明
事件 E;
^
matmul_ocl.cpp:74:32:错误:"NullRange"未在此范围内声明
Q.enqueueNDRangeKernel (K、NullRange、NDRange (MAT_M)、NDRange (1)、NULL、 (&E);
^
matmul_ocl.cpp:74:56:错误:未在此范围内声明'NDRange'
Q.enqueueNDRangeKernel (K、NullRange、NDRange (MAT_M)、NDRange (1)、NULL、 (&E);
^
matmul_ocl.cpp:74:78:错误:'e'未在此范围内声明
Q.enqueueNDRangeKernel (K、NullRange、NDRange (MAT_M)、NDRange (1)、NULL、 (&E);
^
matmul_OCL.CPP:80:40:错误:未在此范围内声明'OCL_DECODE_ERROR'
<< OCL_DECODE_ERROR (ERR.ERR ())<<")<< endl;
^
matmul_OCL.cpp:在全局范围内:
matmul_OCL.cpp:113:1:错误:输入末尾应为'}

^
matmul_OCL.cpp:113:1:错误:
/usr/include/c 中包含的文件输入末尾应为'}'
来自/usr/include/CL/cl.hpp:173、
来自/usr/include/ocl_util.h:37、
从 matmul_ocl.cpp:5:
/usr/include/c ++/5.3.1/bits/stl_vector.h:实例化'std::vector <_Tp, _Alloc>::引用 std::向量 <_Tp, _Alloc>:operator[](std::vector <_Tp, _Alloc>::size_type)[使用_TP = cl:Device;_Alloc = std::分配器 ; std::向量 <_Tp, _Alloc>::reference = cl::Device&;std::vector <_Tp, _Alloc>::size_type = unsigned int]':
matmul_ocl.cpp:51:47:从此处需要
/usr/include/c ++/5.3.1/bits/stl_vector.h:780:41:错误:未完整类型'class cl:Device '的无效使用
{return *(this ->_M_impl._M_START +_n);}
^
包含在/usr/include/ocl_util.h:37:0中、
从 matmul_OCL.CPP:5:
/usr/include/CL/cl.hpp:202:7:注意:'class cl: Device'
class Device 的正向声明;
^
包含在/usr/include/c 中的文件中++/5.3.1/向量:64:0、
来自/usr/include/CL/cl.hpp:173、
来自/usr/include/ocl_util.h:37、
从 matmul_ocl.cpp:5:
/usr/include/c ++/5.3.1/bits/stl_vector.h:在'std::_Vector_BASE 的实例化中 <_Tp, _Alloc>::~ Vector_BASE ()[使用_TP = cl:Device;_Alloc = std::分配器 ]':
/usr/include/c ++/5.3.1/bits/stl_vector.h:425:33:从'STD::向量中需要 <_Tp, _Alloc>::~vector()[使用_TP = cl:Device;_Alloc = std::分配器 ]'
matmul_ocl.cpp:50:72:从此处需要
/usr/include/c ++/5.3.1/bits/stl_vector.h:161:9:错误:不完整类型'class cl:Device '的无效使用
-此->_M_impl._M_START);}
^
包含在/usr/include/ocl_util.h:37:0中、
从 matmul_OCL.CPP:5:
/usr/include/CL/cl.hpp:202:7:注意:'class cl: Device'
class Device 的正向声明;
^
在/usr/include/c 中包含的文件中、++/5.3.1/向量:62:0、
来自/usr/include/CL/cl.hpp:173、
来自/usr/include/ocl_util.h:37、
从 matmul_OCL.CPP:5:
/usr/include/c ++/5.3.1/bits/stl_construct.h:在'void std:::_destroy (_Forwarder、_Forwarder)的实例化中[使用_Forcl Isetator =
std::Device *]':/usr/include/c +/5.3.1/bits/stassertil_Forwarder:151:stdstasset_forwarder:_structure_forstdh <_T2>&)[带_ForwardIterator = cl:Device *;_TP = cl:Device ]'
/usr/include/c ++/5.3.1/bits/stl_vector.h:424:22:从'std::vector 需要 <_Tp, _Alloc>::~vector()[使用_TP = cl:Device;_Alloc = std::分配器 ]'
matmul_ocl.cpp:50:72:从此处需要
/usr/include/c ++/5.3.1/bits/stl_construct.h:127:11:错误:未完整类型'std::迭代器_特征的无效使用 :value_type{aka class cl::Device}'
__destroy (__first、__last);
^
包含在/usr/include/ocl_util.h:37:0中、
从 matmul_OCL.CPP:5:
/usr/include/CL/cl.hpp:202:7:注意:'STD::迭代器_特征的正向声明 :value_type{aka class cl::Device}'
class Device;
^
root@am57xx-EVM:~# 

如果有任何帮助、我们将不胜感激、

B.R、

Alex。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Alex:

      您将哪款处理器 SDK 与您的 EVM 配合使用?  我无法在最新的 PSDK 6.0文件系统上重现此问题。  该示例编译正确。  您还可以在文件系统 上尝试 Processor SDK 附带的 OpenCL 示例:/usr/share/ti/examples/opencl 吗?

      谢谢!

    -元

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Yuan、

    我在 IDK 随附的 SD 卡上使用 Linux SDK 4.4.19 RT、我可以使用  路径中提供的 makefile 在路径/usr/share/ti/examples/opencl 上编译和运行示例(尽管如果我使用  make clean、 之后、make all 会生成错误!!!)。

    root@am57xx-evm:/usr/share/ti/examples/opencl make all
    ============ 平台=========================
    =================== ccode ===================
    =================== 脱机===================
    =================== vecadd ===================
    =================== SGEMM ===================
    =================== 简单================================
    =================== float_compute ===================
    =================== mpy ===================
    =================== DGEMM ===================
    =================== DSPLIB_FFT =========================
    =================== vecadd_openmp ===========
    =================== 缓冲区===================
    =================== vecadd_openmp_t ====
    =================== edmamgr ===================
    =================== null ===================
    =================== ooo_callback =========================
    =================== Monte_Carlo ===================
    =================== offline_embed ===================
    root@am57xx-evm:/usr/share/ti/examples/opencl./dgemm/dgemm
    正在生成随机数据... 完成。 正在启动 DGEMM。
    cMajl C[2048,2048]=A[2048,2048]* B[2048,2048]:
    2 DSP:3.647 GFLOPS (4.710699s)
    1 CPU:1.501 GFLOPS (11.448520s),带 Atlas 库
    通行证!
    root@am57xx-evm:/usr/share/ti/examples/opencl make clean
    root@am57xx-evm:/usr/share/ti/examples/opencl make all
    ============ 平台=========================
    在 main.cpp
    main.cpp:29:0:
    /usr/include/CL/cl.hpp:923:6:错误:令牌""在预处理器表达式
    中无效#if dfinel (use_Al_DEVKCE_Ft委托)
    ^
    /usr/include/CL/cl.hpp:945:1:错误:程序
    #if defined (CL_version_1_1)`
    ^
    /usr/include/CL/cl.hpp:945:1:错误:程序
    /usr/include/CL/cl.hpp
    
    
    /usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp:945:1:程序
    /usr/include/CL/cl.hpp:945:1:程序/usr/include/CL/cl.hpp:945:1:程序
    /usr/include/CL/cl.hpp:945:1:程序:1:程序:945:1:程序:1:杂散错误: 程序
    #if defined (cl_version_1_1)
    ^
    /usr/include/CL/cl.hpp:945:1:错误:程序
    #if defined (cl_version_1_1)@
    ^
    /usr/include/CL/cl.hpp
    
    
    /usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp:
    945:1:错误:程序/usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp:945:945:1:程序
    /usr/include/CL/cl.hpp:1:杂散 R:945:1:程序:1:杂散 R: 程序
    /usr/include/CL/cl.hpp:945:1:`错误:程序
    /usr/include/CL/cl.hpp:945:1:错误:程序
    
    
    
    
    
    /usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp /usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp /usr/include/CL/cl.hpp:945:1:错误:程序/usr/include/CL/cl.hpp:945:1:程序:945:1:程序:945:1:程序:杂散"\337"错误:程序:编辑"945:1:程序杂散"945:1: 程序
    /usr/include/CL/cl.hpp
    
    
    
    
    
    
    
    
    /usr/include/CL/cl.hpp:945:1中的杂散'\24':错误:程序#if defined (CL_version_1_1)^/usr/include/CL/cl.hpp:945:1:错误:程序#if defined (CL_version_1_1)@^^/usr/include/CL/cl.hpp
    
    /usr/include/CL/cl.hpp:947:1:错误:程序#endif (CL_version_1_1)中的杂散'\4':/usr/include/CL/cl.hpp:tray 947_1::tray 947_1::tr 1:tr 1:tr 1:tr 1::tr 947_1:tr 程序
    /usr/include/CL/cl.hpp:947:1中的杂散'\353':错误:程序
    /usr/include/CL/cl.hpp:947:1中的杂散'\337':错误:`程序
    /usr/include/CL/cl.hpp
    
    
    /usr/include/CL/cl.hpp:947:1中的杂散‘\':程序/usr/include/CL/cl.hpp
    /usr/include/CL/cl.hpp:947:1中的杂散'\242':程序/usr/include/CL/cl.hpp:947:1中的杂散‘\254':程序
    /usr/include/CL/cl.hpp:程序中的杂散'\947'\241:947:1':程序中的杂散'\241:947:1':错误: main.cpp
    :29:0:
    /usr/include/CL/cl.hpp:933:1:错误:'pemplet'不命名类型
    struct param_traivs{};
    。
    。
    。
    

    B.R、

    Alex。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Yuan:

    我转到了 SDK 4.9.65、现在我的问题已解决、感谢您的关注。

    B.R、

    Alex。