=head3 Options
#include <isl/schedule.h>
+ int isl_options_set_schedule_max_coefficient(
+ isl_ctx *ctx, int val);
+ int isl_options_get_schedule_max_coefficient(
+ isl_ctx *ctx);
int isl_options_set_schedule_max_constant_term(
isl_ctx *ctx, int val);
int isl_options_get_schedule_max_constant_term(
=over
+=item * schedule_max_coefficient
+
+This option enforces that the coefficients for variable and parameter
+dimensions in the calculated schedule are not larger than the specified value.
+This option can significantly increase the speed of the scheduling calculation
+and may also prevent fusing of unrelated dimensions. A value of -1 means that
+this option does not introduce bounds on the variable or parameter
+coefficients.
+
=item * schedule_max_constant_term
This option enforces that the constant coefficients in the calculated schedule
struct isl_schedule;
typedef struct isl_schedule isl_schedule;
+int isl_options_set_schedule_max_coefficient(isl_ctx *ctx, int val);
+int isl_options_get_schedule_max_coefficient(isl_ctx *ctx);
+
int isl_options_set_schedule_max_constant_term(isl_ctx *ctx, int val);
int isl_options_get_schedule_max_constant_term(isl_ctx *ctx);
"detect simple symmetries in PIP input")
ISL_ARG_CHOICE(struct isl_options, convex, 0, "convex-hull", \
convex, ISL_CONVEX_HULL_WRAP, "convex hull algorithm to use")
+ISL_ARG_INT(struct isl_options, schedule_max_coefficient, 0,
+ "schedule-max-coefficient", "limit", -1, "Only consider schedules "
+ "where the coefficients of the variable and parameter dimensions "
+ "do not exceed <limit>. A value of -1 allows arbitrary coefficients.")
ISL_ARG_INT(struct isl_options, schedule_max_constant_term, 0,
"schedule-max-constant-term", "limit", -1, "Only consider schedules "
"where the coefficients of the constant dimension do not exceed "
gbr_only_first)
ISL_CTX_SET_INT_DEF(isl_options, struct isl_options, isl_options_args,
+ schedule_max_coefficient)
+ISL_CTX_GET_INT_DEF(isl_options, struct isl_options, isl_options_args,
+ schedule_max_coefficient)
+
+ISL_CTX_SET_INT_DEF(isl_options, struct isl_options, isl_options_args,
schedule_max_constant_term)
ISL_CTX_GET_INT_DEF(isl_options, struct isl_options, isl_options_args,
schedule_max_constant_term)
#define ISL_CONVEX_HULL_FM 1
int convex;
+ int schedule_max_coefficient;
int schedule_max_constant_term;
int schedule_parametric;
int schedule_outer_zero_distance;
return 0;
}
+/* Add constraints that bound the values of the variable and parameter
+ * coefficients of the schedule.
+ *
+ * The maximal value of the coefficients is defined by the option
+ * 'schedule_max_coefficient'.
+ */
+static int add_bound_coefficient_constraints(isl_ctx *ctx,
+ struct isl_sched_graph *graph)
+{
+ int i, j, k;
+ int max_coefficient;
+ int total;
+
+ max_coefficient = ctx->opt->schedule_max_coefficient;
+
+ if (max_coefficient == -1)
+ return 0;
+
+ total = isl_basic_set_total_dim(graph->lp);
+
+ for (i = 0; i < graph->n; ++i) {
+ struct isl_sched_node *node = &graph->node[i];
+ for (j = 0; j < 2 * node->nparam + 2 * node->nvar; ++j) {
+ int dim;
+ k = isl_basic_set_alloc_inequality(graph->lp);
+ if (k < 0)
+ return -1;
+ dim = 1 + node->start + 1 + j;
+ isl_seq_clr(graph->lp->ineq[k], 1 + total);
+ isl_int_set_si(graph->lp->ineq[k][dim], -1);
+ isl_int_set_si(graph->lp->ineq[k][0], max_coefficient);
+ }
+ }
+
+ return 0;
+}
+
/* Construct an ILP problem for finding schedule coefficients
* that result in non-negative, but small dependence distances
* over all dependences.
int param_pos;
int n_eq, n_ineq;
int max_constant_term;
+ int max_coefficient;
max_constant_term = ctx->opt->schedule_max_constant_term;
+ max_coefficient = ctx->opt->schedule_max_coefficient;
parametric = ctx->opt->schedule_parametric;
nparam = isl_space_dim(graph->node[0].dim, isl_dim_param);
n_eq += 2 + parametric + force_zero;
if (max_constant_term != -1)
n_ineq += graph->n;
+ if (max_coefficient != -1)
+ for (i = 0; i < graph->n; ++i)
+ n_ineq += 2 * graph->node[i].nparam +
+ 2 * graph->node[i].nvar;
graph->lp = isl_basic_set_alloc_space(dim, 0, n_eq, n_ineq);
isl_int_set_si(graph->lp->ineq[k][0], max_constant_term);
}
+ if (add_bound_coefficient_constraints(ctx, graph) < 0)
+ return -1;
if (add_all_validity_constraints(graph) < 0)
return -1;
if (add_all_proximity_constraints(graph) < 0)