source:
CIVL/mods/dev.civl.com/examples/languageFeatures/civlParforNotConcrete.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 395 bytes | |
| Line | |
|---|---|
| 1 | /* This example is to test the condition that the argument of the domain for $parfor |
| 2 | * is not concrete. |
| 3 | */ |
| 4 | |
| 5 | #include <civlc.cvh> |
| 6 | #include <stdio.h> |
| 7 | $input int n; |
| 8 | $assume (n>1); |
| 9 | |
| 10 | void main(){ |
| 11 | $range r1 = 1 .. n; |
| 12 | $domain(1) dom = ($domain){r1}; |
| 13 | int sum = 0; |
| 14 | |
| 15 | $parfor(int i: dom){ |
| 16 | printf("This is proc %s, my i: %d\n", $self, i); |
| 17 | sum += 1; |
| 18 | printf("sum is %d", sum); |
| 19 | } |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
