Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA How to launch a new kernel call in one kernel function?

Tags:

cuda

I am new to CUDA programming. Now, I have a problem to handle: I am trying to use CUDA parallel programming to handle a set of datasets. And for each datasets, there are some matrix calculation needed to be done.

My design is like this:

  1. Launch N threads to handle each dataset as they are independent to each other and the method to handle them are the same.

  2. In each thread in 1, I want to use a new function and this function also works like a kernel as they are matrix calc... e.g. call M threads to parallel handle matrix calculation..

Does anyone know whether it is possible or not?

like image 207
user2869464 Avatar asked Dec 21 '25 10:12

user2869464


1 Answers

You can launch a kernel from a thread in another kernel if you use CUDA dynamic parallelism and your GPU supports it. GPUs that support CUDA dynamic parallelism currently are of compute capability 3.5.

You can discover the compute capability of your device from the CUDA deviceQuery sample.

You can learn more about how to use CUDA dynamic parallelism from the CUDA programming guide section.

like image 149
Robert Crovella Avatar answered Dec 23 '25 03:12

Robert Crovella