GPU Programming
In GPU programming such as CUDA, what is a "kernel"?
- AThe core of the GPU's operating system
- BA function that many threads execute simultaneously on the GPU
- CA component that cools the GPU chip
Show answer and explanation
Answer: B. A function that many threads execute simultaneously on the GPU
In GPU programming a kernel is a function launched from the CPU-side program in which many GPU threads execute the same code. Each thread uses its own index to choose which data element to handle. For array addition, for example, the kernel is written so that each thread adds one element, and as many threads are launched as there are elements. The word is the same as for an OS kernel, but the meaning differs.
- A. It has a different meaning from an OS kernel.
- B. Correct. It is launched from the CPU and runs in parallel on the GPU.
- C. It is not a cooling component.