Previous | Next --- Slide 25 of 81
Back to Lecture Thumbnails
haoala

What is a kernel function?

apk

@haoala kernels are C functions that, when called, are executed N times in parallel by N different CUDA threads, as opposed to only once like regular C functions. Source

kayvonf

To clarify. This slide shows a fragment shader written in the GLSL language. This is not CUDA code.

For those that have taken graphics: The fragment shader performs a texture lookup to obtain the surface albedo at a point on screen, then performs a basic diffuse lighting computation to modulate the color of the surface by the incident light.

sampathchanda

This shader program seems similar to the function of the shadePixel kernel function provided to us in the Assignment2. That CUDA function too, has taken details regarding a pixel and shaded the pixel accordingly.

kayvonf

@sampathchanda: but there is one interesting difference. Note there is no concept of thread id here. The only data the fragment shader can access are the elements passed to it.