30.04.2014 Views

Segmented Scan - Nvidia

Segmented Scan - Nvidia

Segmented Scan - Nvidia

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Simple Parallel Inclusive <strong>Scan</strong> Code<br />

__device__ int scan(int *p) {<br />

for (int offset=1; offset=offset) t = p[i-offset];<br />

__syncthreads();<br />

if(i>=offset) p[i]= t + p[i];<br />

__syncthreads();<br />

}<br />

}

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

Saved successfully!

Ooh no, something went wrong!