Reputation: 3660
I am trying to compile this. I am using the AMD SDK. I am using the header files that come with the aforementioned SDK and they are located in:
C:\Program Files (x86)\AMD APP\include\CL
The tutorial states:
Header files Just like any other external API used in C++, you must include a header file when using the OpenCL™ API. Usually, this is in the directory CL within the primary include directory. For the C++ bindings we have (replace the straight C API with cl.h):
I found that last bit a little confusing. I am using both .h and .hpp
#include <CL/cl.h> when this is used it will compile the checkErr function
#include <CL/cl.hpp> when this is used it gives me access to the cl namespace
When I try to compile this code it fails with:
'clUnloadCompiler': was declared deprecated
ADDITIONAL DETAILS (after removing #include <CL/c.h>)
It now gives the following list of errors:
error C4996: Error 2 error LNK2019: unresolved external symbol _clReleaseCommandQueue@4 referenced in function "public: static int __cdecl cl::detail::ReferenceHandler<struct _cl_command_queue *>::release(struct _cl_command_queue *)" (?release@?$ReferenceHandler@PAU_cl_command_queue@@@detail@cl@@SAHPAU_cl_command_queue@@@Z)
error LNK2019: unresolved external symbol _clReleaseContext@4 referenced in function "public: static int __cdecl cl::detail::ReferenceHandler<struct _cl_context *>::release(struct _cl_context *)" (?release@?$ReferenceHandler@PAU_cl_context@@@detail@cl@@SAHPAU_cl_context@@@Z)
In properties for my project I have:
The errors I listed happen regardless of whether or not I take the last two steps. That is, the last two do not seem to be helping or harming anything
Upvotes: 1
Views: 1191
Reputation: 8036
That's because clUnloadCompiler()
was deprecated in OpenCL 1.2.
Add
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
to your code before
#include <CL/cl.h>
#include <CL/cl.hpp>
Upvotes: 3
Reputation: 3908
Summary of answers I provided in comments:
#include <CL/cl.hpp>
Upvotes: 3