15.08.2012 Views

Introduction to CUDA C

Introduction to CUDA C

Introduction to CUDA C

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Parallel Addition: add()<br />

� Using our newly parallelized add()kernel:<br />

__global__ void add( int *a, int *b, int *c ) {<br />

}<br />

c[blockIdx.x] = a[blockIdx.x] + b[blockIdx.x];<br />

� Let’s take a look at main()…

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

Saved successfully!

Ooh no, something went wrong!