Changeset 8fe35be for benchmark


Ignore:
Timestamp:
Jul 25, 2022, 12:47:05 PM (21 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
1f950c3b
Parents:
970fa54
Message:

Fixed some benchmarks that were still using stack arrays

Location:
benchmark/readyQ
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/churn.cfa

    r970fa54 r8fe35be  
    5858
    5959                        threads_left = nthreads;
    60                         BThrd * threads[nthreads];
     60                        BThrd ** threads = alloc(nthreads);
    6161                        for(i; nthreads ) {
    6262                                BThrd & t = *(threads[i] = malloc());
     
    9090
    9191                        free(spots);
     92                        free(threads);
    9293                }
    9394
  • benchmark/readyQ/cycle.cfa

    r970fa54 r8fe35be  
    5252                {
    5353                        threads_left = tthreads;
    54                         BThrd * threads[tthreads];
    55                         Partner thddata[tthreads];
     54                        BThrd **  threads = alloc(tthreads);
     55                        Partner * thddata = alloc(tthreads);
    5656                        for(i; tthreads) {
     57                                (thddata[pi]){};
    5758                                unsigned pi = (i + nthreads) % tthreads;
    5859                                thddata[i].next = &thddata[pi].self;
     
    8384                                delete(threads[i]);
    8485                        }
     86                        free(threads);
     87                        free(thddata);
    8588                }
    8689
  • benchmark/readyQ/cycle.cpp

    r970fa54 r8fe35be  
    3939                {
    4040                        threads_left = tthreads;
    41                         Fibre * threads[tthreads];
    42                         Partner thddata[tthreads];
     41                        Fibre * threads = new Fibre *[tthreads]();
     42                        Partner thddata = new Partner[tthreads]();
    4343                        for(unsigned i = 0; i < tthreads; i++) {
    4444                                unsigned pi = (i + nthreads) % tthreads;
     
    6969                                global_blocks  += thddata[i].blocks;
    7070                        }
     71
     72                        delete[](threads);
     73                        delete[](thddata);
    7174                }
    7275
  • benchmark/readyQ/locality.cfa

    r970fa54 r8fe35be  
    222222                threads_left = nprocs;
    223223                {
    224                         MyThread * threads[nthreads];
     224                        MyThread ** threads = alloc(nthreads);
    225225                        for(i; nthreads) {
    226226                                threads[i] = malloc();
     
    259259                                free( threads[i] );
    260260                        }
     261                        free( threads );
    261262                }
    262263
  • benchmark/readyQ/locality.cpp

    r970fa54 r8fe35be  
    217217        {
    218218                FibreInit(1, nprocs);
    219                 MyData * data_arrays[nthreads];
     219                MyData ** data_arrays = new MyData *[nthreads]();
    220220                for(size_t i = 0; i < nthreads; i++) {
    221221                        data_arrays[i] = new MyData( i, wsize );
     
    228228
    229229                threads_left = nthreads - nspots;
    230                 Fibre * threads[nthreads];
    231                 MyCtx * thddata[nthreads];
     230                Fibre ** threads = new Fibre *[nthreads]();
     231                MyCtx ** thddata = new MyCtx *[nthreads]();
    232232                {
    233233                        for(size_t i = 0; i < nthreads; i++) {
     
    267267                        delete( data_arrays[i] );
    268268                }
     269                delete[](data_arrays);
    269270
    270271                for(size_t i = 0; i < nspots; i++) {
    271272                        delete( spots[i] );
    272273                }
     274
     275                delete[](threads);
     276                delete[](thddata);
    273277        }
    274278
  • benchmark/readyQ/yield.cfa

    r970fa54 r8fe35be  
    3434                {
    3535                        threads_left = nthreads;
    36                         Yielder threads[nthreads];
     36                        Yielder * threads = alloc(nthreads);
     37                        for(i; nthreads) {
     38                                (threads[i]){};
     39                        }
     40
    3741                        printf("Starting\n");
    3842
     
    5256                                Yielder & y = join( threads[i] );
    5357                                global_counter += y.count;
     58                                ^(threads[i]){};
    5459                        }
     60                        free(threads);
    5561                }
    5662
  • benchmark/readyQ/yield.cpp

    r970fa54 r8fe35be  
    3333                {
    3434                        threads_left = nthreads;
    35                         Fibre * threads[nthreads];
     35                        Fibre ** threads = new Fibre *[nthreads]();
    3636                        for(unsigned i = 0; i < nthreads; i++) {
    3737                                threads[i] = new Fibre();
     
    5252                                fibre_join( threads[i], nullptr );
    5353                        }
     54                        delete[] threads;
    5455                }
    5556
Note: See TracChangeset for help on using the changeset viewer.