编译Linux上的OpenCL ICD加载程序的错误

时间:2014-04-15 08:05:51

标签: c compilation makefile cmake opencl

尝试在Linux上编译测试OpenCL ICD驱动程序:http://www.khronos.org/registry/cl/specs/opencl-icd-1.2.11.0.tgz(ubuntu 12.04)。

按照README构建:

wget http://www.khronos.org/registry/cl/specs/opencl-icd-1.2.11.0.tgz
tar xvf opencl-icd-1.2.11.0.tgz
cd icd/inc
mkdir CL
cd CL
cp /usr/include/CL/* .
cd ../..
make

但是会抛出错误,例如:

In file included from icd.c:42:0:
icd_dispatch.h:105:5: error: unknown type name 'cl_device_partition_property'
icd_dispatch.h:111:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CL_API_SUFFIX__VERSION_1_2'
icd_dispatch.h:114:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CL_API_SUFFIX__VERSION_1_2'
icd_dispatch.h:177:5: error: unknown type name 'cl_image_desc'
...

看起来cl_device_partition_property应该引用opencl头〜/ icd / inc / CL / cl_ext.h,但由于某种原因没有引用它。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

看起来您正在使用OpenCL 1.1标头,而您正在构建的ICD是1.2。 cl_device_partition_propertycl_image_desc类型在cl.h中定义,但仅在OpenCL 1.2中添加。

您可以从Khronos OpenCL Registry下载OpenCL 1.2标头。