开发者

Getting Started with OpenCL on Windows 7

开发者 https://www.devze.com 2023-04-02 05:08 出处:网络
I am trying to get OpenCL up and running on a Windows 7 machine. The machine has an NVIDIA GEFORCE GT 520M with driver version 8.17.12.6721. 开发者_开发百科

I am trying to get OpenCL up and running on a Windows 7 machine. The machine has an NVIDIA GEFORCE GT 520M with driver version 8.17.12.6721. 开发者_开发百科

Does anyone know about getting started with GPU computing in OpenCL on Windows? Or of a good in-depth resource for getting it all set up? To make this question more specific, I guess I would like to know a) what SDK's and additional files must I download and install on top of the NVIDIA driver and b) how do I compile and run OpenCL code on Windows.


There is no magic to it.

a) You have to install the CUDA SDK

b) To correctly #include the OpenCL header you just need to set the include path of your IDE you to include/CUDA/CL of the SDK you just installed, and link against the OpenCL.lib. That's it!

I can't describe it in detail if I don't know whether you are using Eclipse or Visual Studio or what, but if you don't know yet how to set the include path, there should be tons of instructions to be found via google.


If you are using Visual Studio then you would need to add the include and lib folders to your project as well as adding OpenCL.lib in order for everything to compile correctly. Also you would need to use the #include"CL/cl.h" command in your code.


I have ported an autotool-based project to Windows. You need MingW+msys environment to make autotool and gcc work. Then an OpenCL library is required to build the complete application.

I downloaded an OpenCL sample on nvidia developer's zone, and find the OpenCL.lib for x64 then you need reimp to convert the OpenCL.lib to libOpenCL.a , and copy the libOpenCL.a to mingw's system library path.


pls do the following : 1. read the " open cl in action " appendix A & C by the Matthew Scarpino which will fully explain how to install the open cl SDK on windows & linux

  1. install MinGw32 compiler to let u run the applications on windows : you mcan find more details of it
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号