PDA

View Full Version : A Kernel that run in CPU and GPU same time



luizdrumond
08-25-2012, 09:31 AM
Hi,

Someone have a reference that can indicate or a code example for make a kernel that run in CPU and GPU same time?

I think that it is more for a host code than a kernel code.


Very thanks,

chippies
08-25-2012, 10:04 AM
The AMD APP SDK contains a few examples of multi-GPU code. The main change you would have to make is to query multiple platforms for CPUs and GPUs. I am not aware of any examples that specifically show how to do what you want to do (I haven't really looked, just jumped in and did it my way).

What I find works for multi-GPU code running on AMD and Nvidia GPUs simultaneously is to create a separate context for each device in each platform. You have to allocate buffers on each device and handle splitting the work between the devices by yourself. I also make a copy my kernel for each device. The approach to CPU+GPU programming would be the same. Note that you will have to optimise your kernels for each different device.

luizdrumond
08-29-2012, 11:59 AM
Thank you,

With your response, I think I know what to do.