为opencl程序运行makefile时出错

时间:2012-06-14 11:29:42

标签: makefile opencl

我刚开始学习OpenCL。当我输入make来编译HelloCL程序时,我收到以下错误:

mkdir -p depends/x86_64
perl ../../../../../make/fastdep.pl -I. -I../../../../../include  -I../../../../../samples/opencl/SDKUtil/include --obj-suffix='.o' --obj-prefix='build/debug/x86_64//' HelloCL.cpp > depends/x86_64/HelloCL.depend
mkdir -p build/debug/x86_64/
Building build/debug/x86_64//HelloCL.o
g++  -Wpointer-arith   -Wfloat-equal -g3 -ffor-scope   -I  ../../../../../samples/opencl/SDKUtil/include -I  "/opt/AMDAPP/include"  -I  ../../../../../include  -o build/debug/x86_64//HelloCL.o -c  HelloCL.cpp
In file included from HelloCL.cpp:106:0:
/opt/AMDAPP/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
/opt/AMDAPP/include/CL/cl.hpp:1826:12: error: ‘::clUnloadCompiler’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueMarker(cl::Event*) const’:
/opt/AMDAPP/include/CL/cl.hpp:4842:13: error: ‘::clEnqueueMarker’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueWaitForEvents(const std::vector<cl::Event>&) const’:
/opt/AMDAPP/include/CL/cl.hpp:4849:13: error: ‘::clEnqueueWaitForEvents’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueBarrier() const’:          
/opt/AMDAPP/include/CL/cl.hpp:4985:13: error: ‘::clEnqueueBarrier’ has not been declared                      
make: *** [build/debug/x86_64//HelloCL.o] Error 1    

有人可以帮助我理解我看到的错误,并建议需要进行更正吗?

2 个答案:

答案 0 :(得分:0)

您的SDK支持的OpenCL版本似乎不采用您使用的cl.hpp。试试cl.hpp from the Khronos site

答案 1 :(得分:0)

我建议从以下网址下载最新的AMD APP SDK:http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx

尝试再次运行示例,此SDK支持:OpenCL 1.2,因此您不应该看到任何问题。