| 1 | /* This header file provides types and function prototypes for domains.
|
|---|
| 2 | */
|
|---|
| 3 |
|
|---|
| 4 | #ifndef _DOMAIN_
|
|---|
| 5 | #define _DOMAIN_
|
|---|
| 6 | #pragma CIVL ACSL
|
|---|
| 7 | /* An enumerated type used to specify how domains are decomposed.
|
|---|
| 8 | * This is used, for example, to specify how a domain is partitioned
|
|---|
| 9 | * among members of a thread team at OpenMP "for" loops. The model
|
|---|
| 10 | * checker can explore all possible partitions (very expensive), or
|
|---|
| 11 | * use just one particular partition, or something inbetween.
|
|---|
| 12 | * */
|
|---|
| 13 | typedef enum $domain_strategy {
|
|---|
| 14 | ALL, // decomposition by round robin order
|
|---|
| 15 | RANDOM, // random decomposition
|
|---|
| 16 | ROUND_ROBIN // decomposition by round robin order
|
|---|
| 17 | } $domain_strategy;
|
|---|
| 18 |
|
|---|
| 19 | /* the data structure for the decomposition result of a domain */
|
|---|
| 20 | typedef struct $domain_decomposition {
|
|---|
| 21 | int numSubdomains;
|
|---|
| 22 | $domain subdomains[];
|
|---|
| 23 | } $domain_decomposition;
|
|---|
| 24 |
|
|---|
| 25 | /* takes a domain and some n>0 and returns some partition of the
|
|---|
| 26 | domain into n sub-domains, according to the decomposition strategy
|
|---|
| 27 | specified.
|
|---|
| 28 | */
|
|---|
| 29 | /*@ depends_on \nothing;
|
|---|
| 30 | @ executes_when \true;
|
|---|
| 31 | @*/
|
|---|
| 32 | $system $domain_decomposition $domain_partition($domain domain,
|
|---|
| 33 | $domain_strategy strategy, int n);
|
|---|
| 34 |
|
|---|
| 35 | /* returns the index-th range of the given domain
|
|---|
| 36 | index should be between 1 and the dimension of dom minus 1.
|
|---|
| 37 | */
|
|---|
| 38 | /*@ depends_on \nothing;
|
|---|
| 39 | @ executes_when \true;
|
|---|
| 40 | @*/
|
|---|
| 41 | $system $range $range_of_rectangular_domain($domain dom, int index);
|
|---|
| 42 |
|
|---|
| 43 | /* returns the upper bound of a regular range */
|
|---|
| 44 | /*@ depends_on \nothing;
|
|---|
| 45 | @ executes_when \true;
|
|---|
| 46 | @*/
|
|---|
| 47 | $system int $high_of_regular_range($range range);
|
|---|
| 48 |
|
|---|
| 49 | /* returns the lower bound of a regular range */
|
|---|
| 50 | /*@ depends_on \nothing;
|
|---|
| 51 | @ executes_when \true;
|
|---|
| 52 | @*/
|
|---|
| 53 | $system int $low_of_regular_range($range range);
|
|---|
| 54 |
|
|---|
| 55 | /* returns the step of a regular range */
|
|---|
| 56 | /*@ depends_on \nothing;
|
|---|
| 57 | @ executes_when \true;
|
|---|
| 58 | @*/
|
|---|
| 59 | $system int $step_of_regular_range($range range);
|
|---|
| 60 |
|
|---|
| 61 | /* is this domain a rectangular domain? */
|
|---|
| 62 | /*@ depends_on \nothing;
|
|---|
| 63 | @ executes_when \true;
|
|---|
| 64 | @*/
|
|---|
| 65 | $system _Bool $is_rectangular_domain($domain domain);
|
|---|
| 66 |
|
|---|
| 67 | /* is this range a regular range? */
|
|---|
| 68 | /*@ depends_on \nothing;
|
|---|
| 69 | @ executes_when \true;
|
|---|
| 70 | @*/
|
|---|
| 71 | $system _Bool $is_regular_range($range range);
|
|---|
| 72 |
|
|---|
| 73 | /* returns the dimension of the given domain */
|
|---|
| 74 | /*@ depends_on \nothing;
|
|---|
| 75 | @ executes_when \true;
|
|---|
| 76 | @*/
|
|---|
| 77 | $system int $dimension_of($domain domain);
|
|---|
| 78 |
|
|---|
| 79 | #endif
|
|---|