- Timestamp:
- Dec 28, 2020, 3:08:24 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 06573b2
- Parents:
- ee56a4f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/locality.cfa
ree56a4f r28220d2 63 63 } 64 64 65 void access(MyData & this, size_t idx) {65 __attribute__((nolinline)) void access(MyData & this, size_t idx) { 66 66 size_t l = this.len; 67 67 this.data[idx % l] += 1; … … 126 126 // ================================================== 127 127 // Do some work by accessing 'cnt' cells in the array 128 void work(MyData & data, size_t cnt, uint64_t & state) {128 __attribute__((nolinline)) void work(MyData & data, size_t cnt, uint64_t & state) { 129 129 for (cnt) { 130 130 access(data, __xorshift64(state)); … … 166 166 167 167 void ?{}( MyThread & this, MyData * data, MySpot ** spots, size_t spot_len, size_t cnt, bool share, size_t id) { 168 ((thread&)this){ bench_cluster }; 168 169 this.data = data; 169 170 this.spots.ptr = spots; … … 196 197 unsigned long long global_dmigs = 0; 197 198 198 MyData * data_arrays[nthreads];199 for(i; nthreads) {200 data_arrays[i] = malloc();201 (*data_arrays[i]){ i, wsize };202 }203 204 MySpot * spots[nthreads - nprocs];205 for(i; nthreads - nprocs) {206 spots[i] = malloc();207 (*spots[i]){ i };208 }209 210 199 Time start, end; 211 200 { 201 MyData * data_arrays[nthreads]; 202 for(i; nthreads) { 203 data_arrays[i] = malloc(); 204 (*data_arrays[i]){ i, wsize }; 205 } 206 207 MySpot * spots[nthreads - nprocs]; 208 for(i; nthreads - nprocs) { 209 spots[i] = malloc(); 210 (*spots[i]){ i }; 211 } 212 212 213 BenchCluster bc = { nprocs }; 213 214 threads_left = nprocs; … … 249 250 delete(threads[i]); 250 251 } 252 } 253 254 for(i; nthreads) { 255 delete( data_arrays[i] ); 256 } 257 258 for(i; nthreads - nprocs) { 259 delete( spots[i] ); 251 260 } 252 261 }
Note: See TracChangeset
for help on using the changeset viewer.