Branching CUDA version with dynamic parallelism.