Having finally gotten Dynamic Parallelism up and running, I\'m trying to now implement my model with it. It took me a while to figure out that some strange output resulted from
You probably don't need to synchronize with the parent kernel. Child kernels execute in the order specified by parent kernel and the end of parent kernel is an implicit synchronization point with the last child kernel.
When you use dynamic parallelism, be careful about these items:
The deepest you can go is 24 (CC=3.5).
The number of dynamic kernels pending for launch at the same time is limited ( default 2048 at CC=3.5) but can be increased.
Keep parent kernel busy after child kernel call otherwise with a good chance you waste resources.
I guess your strange wrong results originate from the second factor mentioned above. When you hit the limit, some of dynamic kernels simply don't run and if you don't check for errors, you won't notice because error creation mechanism is per thread.
You can increase this limit by cudaDeviceSetLimit() having cudaLimitDevRuntimePendingLaunchCount as the limit. But the more you specify, the more you consume global memory space. Have a look at section C.4.3.1.3 of the documentation here.