Changeset b067d9b for benchmark


Ignore:
Timestamp:
Oct 29, 2019, 4:01:24 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
773db65, 9421f3d8
Parents:
7951100 (diff), 8364209 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
benchmark
Files:
23 added
35 moved

Legend:

Unmodified
Added
Removed
  • benchmark/Monitor.c

    r7951100 rb067d9b  
    1 #include <fstream>
    2 #include <stdlib>
    3 #include <thread>
     1#include <fstream.hfa>
     2#include <stdlib.hfa>
     3#include <thread.hfa>
    44
    55#include "bench.h"
     
    2929        EndTime = Time();
    3030
    31         sout | ( EndTime - StartTime ) / N | endl;
     31        sout | ( EndTime - StartTime ) / N;
    3232}
  • benchmark/bench.h

    r7951100 rb067d9b  
    1111#else
    1212}
    13 #include <time>
     13#include <time.hfa>
    1414#endif
    1515
     
    4545        statement;                                      \
    4646        EndTime = bench_time();                 \
    47         unsigned long long int output =         \
    48         ( EndTime - StartTime ) / n;
     47        double output =         \
     48            (double)( EndTime - StartTime ) / n;
    4949
    5050#if defined(__cforall)
  • benchmark/creation/cfa_cor.cfa

    r7951100 rb067d9b  
    11#include <stdio.h>
    2 #include <coroutine>
     2#include <coroutine.hfa>
    33
    44#include "bench.h"
     
    77void ?{} (MyCoroutine & this) {
    88#ifdef EAGER
    9         prime(this);
     9        resume(this);
    1010#endif
    1111}
    12 void main(MyCoroutine & this) {}
     12void main(MyCoroutine &) {}
    1313
    1414int main(int argc, char* argv[]) {
    1515        BENCH(
    16                 for (size_t i = 0; i < n; i++) {
     16                for ( i; n ) {
    1717                        MyCoroutine m;
    1818                },
     
    2020        )
    2121
    22         printf("%llu\n", result);
     22        printf("%g\n", result);
    2323}
  • benchmark/creation/cfa_thrd.cfa

    r7951100 rb067d9b  
    11#include <stdio.h>
    2 #include <thread>
     2#include <thread.hfa>
    33
    44#include "bench.h"
    55
    66thread MyThread {};
    7 void main(MyThread & this) {}
     7void main(MyThread &) {}
    88
    99int main(int argc, char* argv[]) {
    1010        BENCH(
    11                 for (size_t i = 0; i < n; i++) {
     11                for ( i; n ) {
    1212                        MyThread m;
    1313                },
     
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/creation/pthreads.c

    r7951100 rb067d9b  
    2525        )
    2626
    27         printf("%llu\n", result);
     27        printf("%g\n", result);
    2828}
  • benchmark/creation/upp_cor.cc

    r7951100 rb067d9b  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/creation/upp_thrd.cc

    r7951100 rb067d9b  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/ctxswitch/cfa_cor.cfa

    r7951100 rb067d9b  
    1 #include <stdio.h>
    2 #include <kernel>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <thread.hfa>
    43
    54#include "bench.h"
     
    1110}
    1211
    13 void main( GreatSuspender & this ) {
     12void main( __attribute__((unused)) GreatSuspender & this ) {
    1413        while( true ) {
    1514                suspend();
     
    2120
    2221        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     22                for ( i; n ) {
    2423                        resume( s );
    2524                },
     
    2726        )
    2827
    29         printf("%llu\n", result);
     28        printf("%g\n", result);
    3029}
  • benchmark/ctxswitch/cfa_thrd2.cfa

    r7951100 rb067d9b  
    1 #include <stdio.h>
    2 #include <thread>
     1#include <thread.hfa>
    32
    43#include "bench.h"
     
    87thread Fibre {};
    98
    10 void main(Fibre & this) {
     9void main(__attribute__((unused)) Fibre & this) {
    1110        while(!done) {
    1211                yield();
     
    1716        Fibre f1;
    1817        BENCH(
    19                 for (size_t i = 0; i < n; i++) {
     18                for ( i; n ) {
    2019                        yield();
    2120                },
     
    2322        )
    2423
    25         printf("%llu\n", result);
     24        printf("%g\n", result);
    2625        done = true;
    2726        return 0;
  • benchmark/ctxswitch/kos_fibre.cpp

    r7951100 rb067d9b  
    1010                result
    1111        )
    12         printf("%llu\n", result);
     12        printf("%g\n", result);
    1313        return 0;
    1414}
  • benchmark/ctxswitch/kos_fibre2.cpp

    r7951100 rb067d9b  
    1919                result
    2020        )
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222        done = true;
    2323        Fibre::yield();
  • benchmark/ctxswitch/pthreads.c

    r7951100 rb067d9b  
    1414        )
    1515
    16         printf("%llu\n", result);
     16        printf("%g\n", result);
    1717}
  • benchmark/ctxswitch/upp_cor.cc

    r7951100 rb067d9b  
    3030        )
    3131
    32         printf("%llu\n", result);
     32        printf("%g\n", result);
    3333}
  • benchmark/ctxswitch/upp_thrd.cc

    r7951100 rb067d9b  
    1111        )
    1212
    13         printf("%llu\n", result);
     13        printf("%g\n", result);
    1414}
  • benchmark/fetch_add.c

    r7951100 rb067d9b  
    1919        )
    2020
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222}
  • benchmark/function.c

    r7951100 rb067d9b  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/loop.c

    r7951100 rb067d9b  
    1111        )
    1212
    13         printf("%llu\n", result);
     13        printf("%g\n", result);
    1414}
  • benchmark/mutex/cfa1.cfa

    r7951100 rb067d9b  
    1 #include <monitor>
     1#include <monitor.hfa>
    22#include <stdio.h>
    33
     
    1010        M m;
    1111        BENCH(
    12                 for (size_t i = 0; i < n; i++) {
     12                for ( i; n ) {
    1313                        call(m);
    1414                },
     
    1616        )
    1717
    18         printf("%llu\n", result);
     18        printf("%g\n", result);
    1919}
  • benchmark/mutex/cfa2.cfa

    r7951100 rb067d9b  
    1 #include <monitor>
     1#include <monitor.hfa>
    22#include <stdio.h>
    33
     
    1010        M m1, m2;
    1111        BENCH(
    12                 for (size_t i = 0; i < n; i++) {
     12                for ( i; n ) {
    1313                        call(m1, m2);
    1414                },
     
    1616        )
    1717
    18         printf("%llu\n", result);
     18        printf("%g\n", result);
    1919}
  • benchmark/mutex/cfa4.cfa

    r7951100 rb067d9b  
    1 #include <monitor>
     1#include <monitor.hfa>
    22#include <stdio.h>
    33
     
    1111        M m1, m2, m3, m4;
    1212        BENCH(
    13                 for (size_t i = 0; i < n; i++) {
     13                for ( i; n ) {
    1414                        call(m1, m2, m3, m4);
    1515                },
     
    1717        )
    1818
    19         printf("%llu\n", result);
     19        printf("%g\n", result);
    2020}
  • benchmark/mutex/pthreads.c

    r7951100 rb067d9b  
    1919        )
    2020
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222}
  • benchmark/mutex/upp.cc

    r7951100 rb067d9b  
    1717        )
    1818
    19         printf("%llu\n", result);
     19        printf("%g\n", result);
    2020}
  • benchmark/schedext/cfa1.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1);
  • benchmark/schedext/cfa2.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1, a2);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1, m2); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1, m2);
  • benchmark/schedext/cfa4.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1, a2, a3, a4);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1, m2, m3, m4); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1, m2, m3, m4);
  • benchmark/schedext/upp.cc

    r7951100 rb067d9b  
    2020                )
    2121
    22                 printf("%llu\n", result);
     22                printf("%g\n", result);
    2323                go = 0;
    2424                return 0;
  • benchmark/schedint/cfa1.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3333
    3434thread T {};
    35 void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     35void ^?{}( T & mutex ) {}
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1);
  • benchmark/schedint/cfa2.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3434thread T {};
    3535void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1, m2); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1, m2);
  • benchmark/schedint/cfa4.cfa

    r7951100 rb067d9b  
    1 #include <kernel>
    2 #include <monitor>
    3 #include <thread>
     1#include <kernel.hfa>
     2#include <monitor.hfa>
     3#include <thread.hfa>
    44#include <stdio.h>
    55
     
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3434thread T {};
    3535void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1, m2, m3, m4); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1, m2, m3, m4);
  • benchmark/schedint/pthreads.c

    r7951100 rb067d9b  
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        pthread_mutex_unlock(&m);
     
    3333}
    3434
    35 void* thread_main(void * a) {
     35void* thread_main(__attribute__((unused)) void * arg ) {
    3636        while(go == 0) { sched_yield(); }
    3737        while(go == 1) { call(); }
     
    3939}
    4040
    41 int main(int margc, char* margv[]) {
    42         argc = margc;
    43         argv = margv;
     41int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4442        pthread_t thread;
    4543        if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
  • benchmark/schedint/upp.cc

    r7951100 rb067d9b  
    2323                )
    2424
    25                 printf("%llu\n", result);
     25                printf("%g\n", result);
    2626                go = 0;
    2727                return 0;
     
    3939};
    4040
    41 int main(int margc, char* margv[]) {
    42         argc = margc;
    43         argv = margv;
     41int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4442        T t;
    4543        return m.wait();
Note: See TracChangeset for help on using the changeset viewer.