08f0322ca42db93e37f65661f51ebbd6f83c4fb6
[IRC.git] / Robust / src / Benchmarks / Scheduling / GC / NON_BAMBOO / RayTracer / Composer.java
1 public class Composer {
2
3   int numCore;
4   int num_composed;
5   //int image[][];
6   int heightPerCore;
7   public long result;
8   public long result1;
9
10   public Composer(int numCore,
11                   int size) {
12     this.numCore = numCore;
13     this.num_composed = 0;
14     heightPerCore = size/this.numCore;
15
16     // set image size
17     //this.image=new int[size][];
18     this.result = 0;
19     this.result1 = 0;
20   }
21   
22   public boolean compose(TestRunner tr) {
23     this.num_composed++;
24     int startidx=0; //heightPerCore * tr.id;
25     int endidx=this.heightPerCore; //startidx + heightPerCore;
26     for(int i = startidx; i < endidx; i++) {
27       //this.image[i] = tr.image[i];
28       for(int j = 0; j < this.heightPerCore*this.numCore; j++) {
29         this.result += tr.image[i][j];
30       }
31     }
32     this.result1 += tr.checksum;
33     return this.num_composed == this.numCore;
34   }
35 }