7 #include <isl/union_map.h>
9 #if defined(__cplusplus)
14 ISL_ARG_DECL(pet_options
, struct pet_options
, pet_options_args
)
16 /* If autodetect is set, any valid scop is extracted.
17 * Otherwise, the scop needs to be delimited by pragmas.
19 int pet_options_set_autodetect(isl_ctx
*ctx
, int val
);
20 int pet_options_get_autodetect(isl_ctx
*ctx
);
32 /* only compound assignments operators before assignment */
51 /* Index into the pet_expr->args array when pet_expr->type == pet_expr_unary
53 enum pet_un_arg_type
{
57 /* Indices into the pet_expr->args array when
58 * pet_expr->type == pet_expr_binary
60 enum pet_bin_arg_type
{
65 /* Indices into the pet_expr->args array when
66 * pet_expr->type == pet_expr_ternary
68 enum pet_ter_arg_type
{
74 /* d is valid when type == pet_expr_double
75 * acc is valid when type == pet_expr_access
76 * call is valid when type == pet_expr_call
77 * op is valid otherwise
79 * acc.access usually maps an iteration space to a data space.
80 * If the access has arguments, however, then the domain of the
81 * mapping is a wrapped mapping from the iteration space
82 * to a space of dimensionality equal to the number of arguments.
83 * Each dimension in this space corresponds to the value of the
84 * corresponding argument.
86 * If the data space is unnamed (and 1D), then it represents
87 * the set of integers. That is, the access represents a value that
88 * is equal to the index.
91 enum pet_expr_type type
;
94 struct pet_expr
**args
;
108 /* If the statement has arguments, i.e., n_arg != 0, then
109 * "domain" is a wrapped map, mapping the iteration domain
110 * to the values of the arguments for which this statement
112 * Otherwise, it is simply the iteration domain.
118 struct pet_expr
*body
;
121 struct pet_expr
**args
;
124 /* context holds constraints on the parameter that ensure that
125 * this array has a valid (i.e., non-negative) size
127 * extent holds constraints on the indices
129 * value_bounds holds constraints on the elements of the array
130 * and may be NULL if no such constraints were specified by the user
132 * element_size is the size in bytes of each array element
134 * live_out is set if the array appears in a live-out pragma
136 * if uniquely_defined is set then the array is written by a single access
137 * such that any element that is ever read
138 * is known to be assigned exactly once before the read
143 isl_set
*value_bounds
;
147 int uniquely_defined
;
150 /* The context describes the set of parameter values for which
151 * the scop can be executed.
152 * context_value describes assignments to the parameters (if any)
153 * outside of the scop.
157 isl_set
*context_value
;
160 struct pet_array
**arrays
;
163 struct pet_stmt
**stmts
;
166 /* Return a textual representation of the operator. */
167 const char *pet_op_str(enum pet_op_type op
);
169 /* Extract a pet_scop from a C source file.
170 * If function is not NULL, then the pet_scop is extracted from
171 * a function with that name.
173 struct pet_scop
*pet_scop_extract_from_C_source(isl_ctx
*ctx
,
174 const char *filename
, const char *function
);
176 /* Update all isl_sets and isl_maps such that they all have the same
177 * parameters in the same order.
179 struct pet_scop
*pet_scop_align_params(struct pet_scop
*scop
);
181 void pet_scop_dump(struct pet_scop
*scop
);
182 void *pet_scop_free(struct pet_scop
*scop
);
184 __isl_give isl_union_set
*pet_scop_collect_domains(struct pet_scop
*scop
);
185 /* Collect all read access relations. */
186 __isl_give isl_union_map
*pet_scop_collect_reads(struct pet_scop
*scop
);
187 /* Collect all write access relations. */
188 __isl_give isl_union_map
*pet_scop_collect_writes(struct pet_scop
*scop
);
189 __isl_give isl_union_map
*pet_scop_collect_schedule(struct pet_scop
*scop
);
191 #if defined(__cplusplus)