27rohitb.github.io

Lecture 2 (Cuda in an afternoon):

By uni of edinburgh (Alan Gray)

I did not complete this video, since it is for C++ and is outdated

Intro to CUDA:

Key points:

Stream model of computation:

Nvidia GPU structure:

Abstraction of data processing:

This is majorly done to maintain compatibility for data processing across different generation of GPUs.
As in LEC1:

Oversubscribing:

Instead of knowing the exact number of cores and SMs for each GPU, we use more blocks than SMs, and more threads than cores. They system will automatically schedule and map it to the architecture of the given GPU. Hence, the same code becomes portable accross different GPU.

dim3 data type:

A new data type in CUDA, contains 3 integers corresponding to x,y,z directions.

dim3 my_xyz( xval, yval, zval);

Accessing value for dim3 data type:

This done using dot operator:

x_component = my_xyz.x