01.12.2012 Views

slides - Friedrich-Schiller-Universität Jena

slides - Friedrich-Schiller-Universität Jena

slides - Friedrich-Schiller-Universität Jena

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

abstract vector processor<br />

array x0(0,n), x1(0,n);<br />

vectors y0, y1<br />

for int m = 1 to c {<br />

vector load/store<br />

for_parallel int i0 = 0 to n step n0 {<br />

array y0(i0-1,i0+n0), y1(i0,i0+n0-1);<br />

y0 = x0;<br />

for_parallel int i = i0 to i0+n0-1 {<br />

y1(i) = if (i==0) 0.0<br />

else if (i==n) 0.0<br />

else 1.0 – y0(i) + 0.5 * ( y0(i-1)+y0(i+1) );<br />

}<br />

x1 = y1;<br />

}<br />

swap(x1, x0);<br />

}<br />

split loop into if/else<br />

split loop into aligned<br />

vector + remainder

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

Saved successfully!

Ooh no, something went wrong!