cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

someperson
Journeyman III

VS 2013 and openCL

Hello everyone!

I just started to learn opencl and having a big problem!

Tried to start with a simple print "Hello, world" ... and a lot of errors when linking.

First, there was a problem with cl :: vector, issue the following error: "'cl :: vector <T, N>': declared deprecate"

left her using std :: vector, but I think that this is not a good idea, maybe then tell me, what's the problem?

And now, the main problem, the problem of linking. I like the set up all the way to the libraries in VS, looked through other forums such an error, I realized that is not linked opencl.lib, #pragma comment (lib, 'OpenCL.lib') did not help. And... nothing helped. text error: "

Ошибка1error LNK2019: a reference to the unresolved external symbol _clGetPlatformIDs@12 в функции "public: static class cl::Platform __cdecl cl::Platform::get(int *)" (?get@Platform@cl@@SA?AV12@PAH@Z)C:\Users\zinjk\documents\visual studio 2013\Projects\openClTest\openClTest\OpenClTest.objopenClTest

Can tell what the project settings should be in visual studio.

I am using visual studio 2013 and AMD APP SDK 2.9-1.

Thank you in advance for any help.

Pleeeease, help me!

0 Likes
4 Replies
jtrudeau
Staff
Staff

Re: VS 2013 and openCL

In case you haven't, in the OpenCL forum, you can "Search This Forum" and look for a useful phrase, like Visual Studio. You may find useful info.

Even if the indicator says it isn't answered, look anyway It is only in the past couple of months that I have pushed people to mark answers, to make a search like this more functional.

0 Likes
someperson
Journeyman III

Re: VS 2013 and openCL

For now it's working, but there appeared something interesting.

when compiling appeared about ~150 errors, but program working.

The error associated with the same "cl :: vector <T, N>': declared deprecated"

It is generally legally? What's the problem, I do not understand.

0 Likes
thesmith
Adept I

Re: Re: VS 2013 and openCL

cl::vector has been deprecated since OpenCL 1.2 I believe. Just make sure you don't have this:

#define __NO_STD_VECTOR

Then, just use std vectors. You can use them for OpenCL types as well:


std::vector<cl::Device> myDevices;


std::vector<cl::Platform> myPlatforms;


std::vector<cl::Event> myEvents;


std::vector has more functionality than the cl::vector. As to why the latter was created in the first place, I can't tell.

jtrudeau
Staff
Staff

Re: VS 2013 and openCL

thesmith  Thanks for helping out.

I'll add just one more thing, perhaps in excess of caution. The compiler is reporting an error regarding that code construct, but it still works. Because it is deprecated, support for this in the compiler can vanish at any time without further warning (something might appear in a release note, but support will vanish some day). The warning essentially says "Don't do this any more" but it still works for the time being.

0 Likes