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.

A More Complex Example<br />

� A simple kernel <strong>to</strong> add two integers:<br />

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

}<br />

*c = *a + *b;<br />

� As before, __global__ is a <strong>CUDA</strong> C keyword meaning<br />

— add() will execute on the device<br />

— add() will be called from the host

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

Saved successfully!

Ooh no, something went wrong!