Determine the loopcarried interiteration dependencies in the
Determine the loopcarried (interiteration) dependencies in the following loop and rewrite it so that it is parallel.
for (i = 1; i<=99; i++) {
a[i] = b[i] + c[i]; /S1/
b[i] = a[i] + d[i]; /S2/
a[i+1] = a[i] + e[i]; /S3/
}
Solution
loop1: for (i = 1; i<=99; i++) {
a[i] = b[i] + c[i]; /S1/
}
loop2: for (i = 1; i<=99; i++) {
b[i] = a[i] + d[i]; /S2/
}
loop3: for (i = 1; i<=99; i++) {
a[i+1] = a[i] + e[i]; /S3/
}
![Determine the loopcarried (interiteration) dependencies in the following loop and rewrite it so that it is parallel. for (i = 1; i<=99; i++) { a[i] = b[i] + Determine the loopcarried (interiteration) dependencies in the following loop and rewrite it so that it is parallel. for (i = 1; i<=99; i++) { a[i] = b[i] +](/WebImages/11/determine-the-loopcarried-interiteration-dependencies-in-the-1007943-1761519904-0.webp)