Results 1 to 9 of 9

Thread: How to compile OpenCL example in GCC?

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    3

    How to compile OpenCL example in GCC?

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

    thanks,
    nalox

  2. #2
    Junior Member
    Join Date
    Sep 2009
    Posts
    4

    Re: How to compile OpenCL example in GCC?

    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

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    8

    Re: How to compile OpenCL example in GCC?

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

    '-framework OpenCL'

    Would be the normal mac way of doing this...

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: How to compile OpenCL example in GCC?

    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.

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Posts
    4

    Re: How to compile OpenCL example in GCC?

    Ok, thanks, I'll try it.

  6. #6
    Junior Member
    Join Date
    Sep 2009
    Posts
    4

    Re: How to compile OpenCL example in GCC?

    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

  7. #7
    Junior Member
    Join Date
    Sep 2009
    Posts
    4

    Re: How to compile OpenCL example in GCC?

    Quote Originally Posted by aplyer
    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.

  8. #8
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: How to compile OpenCL example in GCC?

    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.

  9. #9
    Junior Member
    Join Date
    Sep 2009
    Posts
    8

    Re: How to compile OpenCL example in GCC?

    <shamless plug>I'm also working on a proof of concept implementation that runs on any (POSIX) Cluster using OpenMPI</shamless plug>
    http://sf.net/projects/clumpi/

Similar Threads

  1. How to compile OpenCL example in GCC?
    By nalox in forum OpenCL
    Replies: 0
    Last Post: 05-20-2009, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •