source: CIVL/examples/translation/cuda/stream_test.cvl@ 764d472

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 764d472 was a86ac45, checked in by Andre Marianiello <andre.marianiello@…>, 12 years ago

Moved a few more files over from the civl-papers/examples repo

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1187 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 509 bytes
Line 
1#include "civlc.h"
2#include "stdio.h"
3
4$input int N;
5$input int B;
6$assume(0 <= N && N <= B);
7
8int actual;
9
10void f ($proc prev, int i) {
11 $wait(prev);
12 actual = i - actual;
13}
14
15void g (){}
16
17
18int main ( void ) {
19
20 actual = 0;
21 $proc last_proc = $spawn g();
22 for (int i = 0; i < N; i++)
23 last_proc = $spawn f(last_proc, i);
24
25 int expected = 0;
26 for (int i = 0; i < N; i++)
27 expected = i - expected;
28
29 $wait(last_proc);
30 printf("expected = %d, actual = %d\n", expected, actual);
31 $assert(actual == expected);
32}
Note: See TracBrowser for help on using the repository browser.