ADT
arm-eh
ast-experimental
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
pthread-emulation
qualifiedEnum
Last change
on this file since 6b6a3b8 was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago |
update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages
|
-
Property mode
set to
100644
|
File size:
550 bytes
|
Line | |
---|
1 | #include <cstdio>
|
---|
2 |
|
---|
3 | #include "bench.h"
|
---|
4 |
|
---|
5 | volatile int go = 0;
|
---|
6 |
|
---|
7 | _Monitor M {
|
---|
8 | public:
|
---|
9 | void __attribute__((noinline)) call() {}
|
---|
10 |
|
---|
11 | int __attribute__((noinline)) wait() {
|
---|
12 | go = 1;
|
---|
13 | for (size_t i = 0; i < times; i++) {
|
---|
14 | _Accept(call);
|
---|
15 | }
|
---|
16 | go = 0;
|
---|
17 | return 0;
|
---|
18 | }
|
---|
19 | };
|
---|
20 |
|
---|
21 | M m;
|
---|
22 |
|
---|
23 | _Task T {
|
---|
24 | void main() {
|
---|
25 | while(go == 0) { yield(); }
|
---|
26 | BENCH(
|
---|
27 | while(go == 1) { m.call(); },
|
---|
28 | result
|
---|
29 | )
|
---|
30 | printf( "%g\n", result );
|
---|
31 | }
|
---|
32 | };
|
---|
33 |
|
---|
34 | int main( int argc, char * argv[] ) {
|
---|
35 | BENCH_START()
|
---|
36 | T t;
|
---|
37 | return m.wait();
|
---|
38 | }
|
---|
39 |
|
---|
40 | // Local Variables: //
|
---|
41 | // tab-width: 4 //
|
---|
42 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.