Kaushik
Kaushik

Reputation: 449

When is the Kernel Function added to the GPU's queue?

I need to know at what point of time does the kernel function get added to the GPU queue. I did an ltrace of the CUDA program and got several invocations like 1.cudaconfigurecall 2.cudamemcpy and i also got cudaLaunch() My question is does the particular kernel function get added when cudaLaunch is invoked or sometime before or after that. Which is the function responsible for adding the kernel function to the queue.?

Upvotes: 0

Views: 142

Answers (1)

talonmies
talonmies

Reputation: 72348

The function gets added when cudaLaunch is called. The prior API calls, such as cudaSetupArgument and cudaConfigureCall, reserve and intialise call a stack frame for the upcoming kernel launch, but the stack frame doesn't get associated with a given kernel function and doesn't get pushed to the device until cudaLaunch is called. All of these functions have their own documentation in the CUDA toolkit, you can read about them here.

Upvotes: 3

Related Questions