Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to execute OpenCL code on a PC which doesn't have a graphics card, nor any other hardware component which is able to execute OpenCL. Is it possible compile my OpenCL code in a way that it can be executed on the CPU in Linux? Or is it possible to simulate a GPU environment on the CPU?

Note: It's about testing whether the code works as expected, not about performance.

share|improve this question
    
Take a look at pocl: pocl.sourceforge.net – AkiRoss Oct 26 '13 at 12:54
up vote 6 down vote accepted

This looks like what you need, although you probably need to recompile, and the SDK linked from there appears specific to Intel CPUs; this link to AMD's documentation appears to describe the equivalent for AMD CPUs.

share|improve this answer
    
I could have come to this myself... The solution was simply to change CL_DEVICE_TYPE_GPU to CL_DEVICE_TYPE_CPU as described in the first link... – Misch Apr 29 '13 at 19:25
    
Well, if I saved you some time, I'd say that's a win for both of us. Glad to be of help! – Aaron Miller Apr 29 '13 at 19:38
    
Definitely saved me some time, thanks for the help :) – Misch Apr 29 '13 at 19:48
    
You may need to use "device fission" to fully use n-1 cores instead of not-fully using n cores. – huseyin tugrul buyukisik May 15 '13 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .