29.01.2013 Views

Tutorial CUDA

Tutorial CUDA

Tutorial CUDA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Kernel = Many Concurrent Threads<br />

One kernel is executed at a time on the device<br />

Many threads execute each kernel<br />

© NVIDIA Corporation 2008<br />

Each thread executes the same code…<br />

… on different data based on its threadID<br />

<strong>CUDA</strong> threads might be<br />

threadID<br />

Physical threads<br />

As on NVIDIA GPUs<br />

GPU thread creation and<br />

context switching are<br />

essentially free<br />

Or virtual threads<br />

E.g. 1 CPU core might execute<br />

multiple <strong>CUDA</strong> threads<br />

0 1 2 3 4 5 6 7<br />

…<br />

float x = input[threadID];<br />

float y = func(x);<br />

output[threadID] = y;<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!