OpenCL sample code

Discussion in 'Mac Programming' started by ManiG, Aug 29, 2009.

  1. ManiG macrumors member

    Aug 11, 2009
    So, I've downloaded and compiled some of Apple's OpenCL sample code.

    Pretty much none of them work for me, except for the Hello World example.

    Has anyone else had any luck? I'm assuming the OpenCL spec has changed since these were last worked on (since the error occurs when trying to load the .cl files), and some tweaks need to be make to the kernel code.

    In particular, the following sample projects don't work for me:


    Any help appreciated!

    /Users/mani/Downloads/OpenCL_Procedural_Noise_Example/build/Debug/noise ; exit;
    Galactus:~ mani$ /Users/mani/Downloads/OpenCL_Procedural_Noise_Example/build/Debug/noise ; exit;
    Using active OpenGL context...
    Connecting to AMD Radeon HD 4870...
    Loading kernel source from file ''...
    Error opening file
    Failed to setup compute kernel! Error -8
    [Process completed]
  2. kainjow Moderator emeritus


    Jun 15, 2000
    OpenCL_Procedural_Grass_and_Terrain_Example worked for me (NVIDIA GeForce 9400M).

  3. ManiG thread starter macrumors member

    Aug 11, 2009
    That is worrisome for me. :(

    Can anyone with a 4870, flashed or not, let me know if the OpenCL samples work?
  4. ManiG thread starter macrumors member

    Aug 11, 2009
  5. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    I don't have that graphics card but it does work on my Mac Pro with the Nvidia 8800GT. Maybe it is an ATI thing?

    Also I had to switch the compiler from the default (GCC 4.2) to LLVM Clang to get it too work for me.

    Attached Files:

  6. rharder macrumors newbie

    Jun 21, 2002
    Those samples specifically show how OpenCL and OpenGL can share buffers, so if you don't have a compatible card, they won't run. If you _do_ have a compatible card...sorry, don't know.

    I have a Radeon card, so I've had to modify most of the samples to not try to look for a GPU and just run on the CPU, but I can't fake the OpenGL/OpenCL buffer sharing thing that way.


Share This Page