28.11.2014 Views

Lecture 2 – Threads - many-core.group

Lecture 2 – Threads - many-core.group

Lecture 2 – Threads - many-core.group

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Kernel for c = a + b<br />

__global__ void vector_add_kernel (float *a, float *b,<br />

float *c)<br />

{<br />

int i<br />

i = threadIdx.x;<br />

// add i’th elements <br />

c[i] = a[i] + b[i]; <br />

}

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

Saved successfully!

Ooh no, something went wrong!