Difference: CS255Spring10ProjectHome (16 vs. 17)

Revision 172010-04-14 - XiaoyaXiang

Line: 1 to 1
 
META TOPICPARENT name="CS255Spring10"
Line: 250 to 250
 
    // there is loop-carried dependence in this example
    for (i=0; i < N; i++){
Changed:
<
<
c[i] = t; t = a[i] + b[i];
>
>
t=a[i]+b[i] c[i]=t+1/t;
  }

// you can use scalar expansion to eliminate the dependence and get the following code for (i=0; i < N; i++){

Deleted:
<
<
c[i] = t[i];
  t[i] = a[i] + b[i];
Added:
>
>
c[i]= t[i] + 1/t[i];
  } t = t [N-1];
Line: 268 to 268
  { #pragma omp for schedule(dynamic,chunk) nowait for (i=0; i < N; i++){
Deleted:
<
<
c[i] = t[i];
  t[i] = a[i] + b[i];
Added:
>
>
c[i] = t[i] + 1/t[i];
  } } // end of parallel section t = t[N-1];
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback