Global memory streaming

I am trying to understand coding using GPUs. It’s a little difficult for me to understand the interaction of GPU threads with global memory.

I know when we post or copy something on the device, which is done by reference. But when we try to access global memory in a thread, what exactly happens? Do all threads try to access memory at the same time, which leads to serial execution, or do they all create their own copies or something else?

Any help would be greatly appreciated.

+4
source share
1 answer

, , - ?

, . , , :

int idx = blockIdx.x * blockDim.x + threadIdx.x;
outArr[idx] = a[idx] + b[idx];

() . . / . , , atomic functions.

/ / ( DRAM), ( : 0, 1, 2, 3 0x0,0x4x4x8,0xc, ). CUDA, 2.4 CUDA.

, !

+1

Source: https://habr.com/ru/post/1624790/


All Articles