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

使用する cl.hpp は、SDK がサポートする OpenCL のバージョンに採用されていないようです。Khronos サイトの cl.hpp を試してください。

于 2012-06-16T00:31:30.377 に答える
0

最新の AMD APP SDK をhttp://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspxからダウンロードすることをお勧めします。

サンプルをもう一度実行してみてください。この SDK は OpenCL 1.2 をサポートしているため、問題は発生しません。

于 2012-06-18T02:51:02.780 に答える