nesting kernels? is it possible?


are there sample applications that do anything like this?

 = you've got one kernel running on (hardware) device#1
 = from that kernel, call another kernel to run on device#2
                                  before device#1's kernel finishes

I mean, obviously you could
= have device #1 writing to host memory as its kernel runs
= have the host waiting for some flag to appear there
and when it does, fire up another device, which
also writes to host memory that’s available for the first kernel to use

But can you do it directly by calling a kernel from a kernel?

At present, you can’t call kernels from kernels and you can’t transfer data directly from device to device or have one device trigger events on another device. All the coordination must be done by the host. And if you want to drive multiple devices from a single application. you need one host thread per device.

Thanks, that’s what I thought.

Are there sample apps that drive multiple devices from a single application, using one host thread per device?

I think I don’t know how to create independent host threads from C code…

There is no C language level intrinsics for doing threading. You will need to use an external threading library. There is an example called simpleMultiGPU in the SDK that uses either windows native threads or pthreads, depending on what OS you are using.