Loop-level parallelism: Difference between revisions

Content deleted Content added
Aishwinth (talk | contribs)
Minor edits
Aishwinth (talk | contribs)
No edit summary
Line 169:
}
</syntaxhighlight>
Note that now loop1 and loop2 can be executed in parallel. Instead of single instruction being performed in parallel on different data as in data level parallelism, here different loops perform different tasks on different data. WeLet's callsay thisthe typetime of parallelismexecution eitherof S1 and S2 functionbe or<math>Ts1</math> taskand parallelism.<math>Ts2
</math> then the execution time for sequential form of above code is <math>n*(Ts1+Ts2)</math>, Now because we split the two statements and put them in two different loops, gives us an execution time of <math>n*Ts1 + Ts2</math>. We call this type of parallelism either function or task parallelism.
 
Let's say the time of execution of S1 and S2 be <math>Ts1</math> and <math>Ts2
</math> then the execution time for sequential form of above code is <math>n*(Ts1+Ts2)</math>, Now because we split the two statements and put them in two different loops, gives us an execution time of <math>n*Ts1 + Ts2</math>.
 
=== DOALL parallelism ===