OpenCL is for Everyone!

October 8, 2009 Matteo Bertozzi | Filed Under OpenCL | No Comments

OpenCLLast night I had a terrible nightmare, where all the apple/mac bloggers says “This app cannot be use used with older macs because it uses OpenCL, so you need the newest NVidia…”

..Fortunately, was just a nightmare. Everyone can use OpenCL, old macs (as my macbook) cannot use GPU, and cannot run faster, but OpenCL code can run on every machine.

You (as developer) need just to keep in mind to get Device in this way. So, if you haven’t the latest NVidia you can still use, as always, CPU.

err = clGetDeviceIDs(NULL, CL_DEVICE_TYPE_GPU, 1, &device_id, NULL);
if (err != CL_SUCCESS)
    err = clGetDeviceIDs(NULL, CL_DEVICE_TYPE_CPU, 1, &device_id, NULL);

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>