Kernel Function Call
Calling a GPU kernel function is very similar to calling a regular function. CUDA, however, introduces an execution configuration syntax (also called the chevron syntax) to configure and launch a grid to execute the kernel function and any device functions. The "<<<, >>>
" brackets contain configuration parameters that specify the degree of parallelism at runtime. Kernel functions can only be called this way. The following is an example of a kernel call.
In future pages, the BlocksPerGrid
and ThreadsPerBlock
parameters are related to the thread abstraction model supported by CUDA. The chevron parameters define how many threads will be launched, and how the work in the device code is to be divided among teams of threads running in parallel. We will discuss the proper usage of these parameters in 2D and 3D Threads and Blocks, as part of the topic, "CUDA Higher-Level Constructs".
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)