0

我刚刚开始学习 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    

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

4

2 回答 2

0

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

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

于 2012-06-18T02:51:02.780 回答
0

看起来您使用的 cl.hpp 没有被您的 SDK 支持的 OpenCL 版本采用。尝试来自 Khronos 站点的 cl.hpp

于 2012-06-16T00:31:30.377 回答