Changeset 28220d2 for benchmark


Ignore:
Timestamp:
Dec 28, 2020, 3:08:24 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Many fixes to locality benchmark

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.cfa

    ree56a4f r28220d2  
    6363}
    6464
    65 void access(MyData & this, size_t idx) {
     65__attribute__((nolinline)) void access(MyData & this, size_t idx) {
    6666        size_t l = this.len;
    6767        this.data[idx % l] += 1;
     
    126126// ==================================================
    127127// 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) {
    129129        for (cnt) {
    130130                access(data, __xorshift64(state));
     
    166166
    167167void ?{}( MyThread & this, MyData * data, MySpot ** spots, size_t spot_len, size_t cnt, bool share, size_t id) {
     168        ((thread&)this){ bench_cluster };
    168169        this.data = data;
    169170        this.spots.ptr = spots;
     
    196197        unsigned long long global_dmigs = 0;
    197198
    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 
    210199        Time start, end;
    211200        {
     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
    212213                BenchCluster bc = { nprocs };
    213214                threads_left = nprocs;
     
    249250                                delete(threads[i]);
    250251                        }
     252                }
     253
     254                for(i; nthreads) {
     255                        delete( data_arrays[i] );
     256                }
     257
     258                for(i; nthreads - nprocs) {
     259                        delete( spots[i] );
    251260                }
    252261        }
Note: See TracChangeset for help on using the changeset viewer.