How to compile OpenCL example in GCC?

Some one know how to compile OpenCL example with gcc or VC?

thanks,
nalox :oops:

I have the same question as you.
I want to add an OpenCl part in my C++ code but i don’t know how to compile it.
I use makefiles to compile my projects and have Snow Leopard installed.

Thanks

I don’t actually have snow leopard here, so I’m guessing, but

‘-framework OpenCL’

Would be the normal mac way of doing this…

Using OpenCL isn’t any different than any other library. Tell your compiler how to link against the library (on the Mac you use the -framework option) and include the appropriate header files.

Ok, thanks, I’ll try it.

Precisely, the kernel compilation in OpenCL is make in running time (library call).

In Gcc, for compilation, you only need the headers (aviables on Kronos site). But for linkage, you have to install OpenCL compatible driver.

in the Makefile :
for Mac OSX : -framework OpenCL
for Linux : -lOpenCL

Sorry, OpenCL run on Linux too ??? I think they only run in MAC and afterwards in Windows 7 and maybe in nexts version of linux kernel.

The supported platforms depend on the vendor. I believe that AMD has CPU support for linux and Nvidia has GPU support for linux. The only CPU/GPU support I know of today is on the Mac, but the platform layer should (at some point, at least) allow you to use two vendor’s implementations together.

<shamless plug>I’m also working on a proof of concept implementation that runs on any (POSIX) Cluster using OpenMPI</shamless plug>