MULTI-DIMENSIONAL THREADS
Each CUDA kernel is executed by a grid, which contains
- a 3d thread blocks
- a 3d threads

Each thread executes the same program
- on distinct data inputs
- single program multipul data model (SPMD)

like the operation system:
- cooperation happens within a block.
- threads in different block cooperate less
MAPPING THREADS TO MULTIDIMENSIONAL DATA
How to calculate the gird?

每个block中的thread 处理一个图片中的像素How to deal with the idle threads
如何计算当前thread对应在图像中的行数和列数

而当前的如果是灰度图,拿到的就是真实的下标,而RGB图片有三个通道,并且张量形式为(width,height,channels),每个像素都有三个分量,需要乘以3才是当前图像中像素的位置在张量中的下标
