View Full Version : A Kernel that run in CPU and GPU same time
08-25-2012, 10:31 AM
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.
08-25-2012, 11: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.
08-29-2012, 12:59 PM
With your response, I think I know what to do.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.