diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | basis_reduction_templ.c | 1 | ||||
-rw-r--r-- | bound.c | 1 | ||||
-rw-r--r-- | cat.c | 1 | ||||
-rw-r--r-- | closure.c | 1 | ||||
-rw-r--r-- | doc/user.pod | 19 | ||||
-rw-r--r-- | include/isl/ctx.h | 52 | ||||
-rw-r--r-- | include/isl/options.h | 56 | ||||
-rw-r--r-- | include/isl/schedule.h | 3 | ||||
-rw-r--r-- | isl_bernstein.c | 1 | ||||
-rw-r--r-- | isl_bound.c | 1 | ||||
-rw-r--r-- | isl_convex_hull.c | 1 | ||||
-rw-r--r-- | isl_ctx.c | 1 | ||||
-rw-r--r-- | isl_lp.c | 1 | ||||
-rw-r--r-- | isl_map.c | 1 | ||||
-rw-r--r-- | isl_options.c | 17 | ||||
-rw-r--r-- | isl_options_private.h | 53 | ||||
-rw-r--r-- | isl_sample.c | 1 | ||||
-rw-r--r-- | isl_schedule.c | 1 | ||||
-rw-r--r-- | isl_tab_pip.c | 1 | ||||
-rw-r--r-- | isl_test.c | 1 | ||||
-rw-r--r-- | isl_transitive_closure.c | 1 | ||||
-rw-r--r-- | pip.c | 1 |
23 files changed, 168 insertions, 49 deletions
diff --git a/Makefile.am b/Makefile.am index 6575477d..5a8d307c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -92,6 +92,7 @@ libisl_la_SOURCES = \ isl_id_private.h \ isl_obj.c \ isl_options.c \ + isl_options_private.h \ isl_output.c \ isl_qsort.c \ isl_qsort.h \ diff --git a/basis_reduction_templ.c b/basis_reduction_templ.c index 2e4034ff..f4c50edd 100644 --- a/basis_reduction_templ.c +++ b/basis_reduction_templ.c @@ -13,6 +13,7 @@ #include <stdlib.h> #include <isl_ctx_private.h> #include <isl_map_private.h> +#include <isl_options_private.h> #include "isl_basis_reduction.h" static void save_alpha(GBR_LP *lp, int first, int n, GBR_type *alpha) @@ -2,6 +2,7 @@ #include <isl/stream.h> #include <isl_polynomial_private.h> #include <isl_scan.h> +#include <isl/options.h> struct bound_options { struct isl_options *isl; @@ -2,6 +2,7 @@ #include <isl/obj.h> #include <isl/printer.h> #include <isl/stream.h> +#include <isl/options.h> struct isl_arg_choice cat_format[] = { {"isl", ISL_FORMAT_ISL}, @@ -1,5 +1,6 @@ #include <assert.h> #include <isl/map.h> +#include <isl/options.h> int main(int argc, char **argv) { diff --git a/doc/user.pod b/doc/user.pod index ca66e193..82643c17 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -4065,6 +4065,25 @@ A representation of the band can be printed using __isl_take isl_printer *p, __isl_keep isl_band *band); +=head3 Options + + #include <isl/schedule.h> + int isl_options_set_schedule_outer_zero_distance( + isl_ctx *ctx, int val); + int isl_options_get_schedule_outer_zero_distance( + isl_ctx *ctx); + +=over + +=item * schedule_outer_zero_distance + +It this option is set, then we try to construct schedules +where the outermost scheduling dimension in each band +results in a zero dependence distance over the proximity +dependences. + +=back + =head2 Parametric Vertex Enumeration The parametric vertex enumeration described in this section diff --git a/include/isl/ctx.h b/include/isl/ctx.h index 3ddc451e..43e0fc66 100644 --- a/include/isl/ctx.h +++ b/include/isl/ctx.h @@ -14,8 +14,8 @@ #include <stdlib.h> #include <isl/int.h> -#include <isl/options.h> #include <isl/blk.h> +#include <isl/arg.h> #include <isl/hash.h> #include <isl/config.h> @@ -161,6 +161,56 @@ st *isl_ctx_peek_ ## prefix(isl_ctx *ctx) \ return (st *)isl_ctx_peek_options(ctx, &(args)); \ } +#define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field) \ +int prefix ## _get_ ## field(isl_ctx *ctx) \ +{ \ + st *options; \ + options = isl_ctx_peek_ ## prefix(ctx); \ + if (!options) \ + isl_die(ctx, isl_error_invalid, \ + "isl_ctx does not reference " #prefix, \ + return -1); \ + return options->field; \ +} + +#define ISL_CTX_SET_BOOL_DEF(prefix,st,args,field) \ +int prefix ## _set_ ## field(isl_ctx *ctx, int val) \ +{ \ + st *options; \ + options = isl_ctx_peek_ ## prefix(ctx); \ + if (!options) \ + isl_die(ctx, isl_error_invalid, \ + "isl_ctx does not reference " #prefix, \ + return -1); \ + options->field = val; \ + return 0; \ +} + +#define ISL_CTX_GET_CHOICE_DEF(prefix,st,args,field) \ +int prefix ## _get_ ## field(isl_ctx *ctx) \ +{ \ + st *options; \ + options = isl_ctx_peek_ ## prefix(ctx); \ + if (!options) \ + isl_die(ctx, isl_error_invalid, \ + "isl_ctx does not reference " #prefix, \ + return -1); \ + return options->field; \ +} + +#define ISL_CTX_SET_CHOICE_DEF(prefix,st,args,field) \ +int prefix ## _set_ ## field(isl_ctx *ctx, int val) \ +{ \ + st *options; \ + options = isl_ctx_peek_ ## prefix(ctx); \ + if (!options) \ + isl_die(ctx, isl_error_invalid, \ + "isl_ctx does not reference " #prefix, \ + return -1); \ + options->field = val; \ + return 0; \ +} + enum isl_error isl_ctx_last_error(isl_ctx *ctx); void isl_ctx_reset_error(isl_ctx *ctx); void isl_ctx_set_error(isl_ctx *ctx, enum isl_error error); diff --git a/include/isl/options.h b/include/isl/options.h index 8ef0f7f7..41616ad4 100644 --- a/include/isl/options.h +++ b/include/isl/options.h @@ -11,61 +11,23 @@ #define ISL_OPTIONS_H #include <isl/arg.h> +#include <isl/ctx.h> #if defined(__cplusplus) extern "C" { #endif -struct isl_options { - #define ISL_LP_TAB 0 - #define ISL_LP_PIP 1 - unsigned lp_solver; +struct isl_options; - #define ISL_ILP_GBR 0 - #define ISL_ILP_PIP 1 - unsigned ilp_solver; - - #define ISL_PIP_TAB 0 - #define ISL_PIP_PIP 1 - unsigned pip; - - #define ISL_CONTEXT_GBR 0 - #define ISL_CONTEXT_LEXMIN 1 - unsigned context; - - #define ISL_GBR_NEVER 0 - #define ISL_GBR_ONCE 1 - #define ISL_GBR_ALWAYS 2 - unsigned gbr; - unsigned gbr_only_first; - - #define ISL_CLOSURE_ISL 0 - #define ISL_CLOSURE_BOX 1 - unsigned closure; - - #define ISL_BOUND_BERNSTEIN 0 - #define ISL_BOUND_RANGE 1 - int bound; - - #define ISL_BERNSTEIN_FACTORS 1 - #define ISL_BERNSTEIN_INTERVALS 2 - int bernstein_recurse; - - int bernstein_triangulate; - - int pip_symmetry; - - #define ISL_CONVEX_HULL_WRAP 0 - #define ISL_CONVEX_HULL_FM 1 - int convex; +ISL_ARG_DECL(isl_options, struct isl_options, isl_options_args) - int schedule_parametric; - int schedule_outer_zero_distance; - int schedule_maximize_band_depth; - int schedule_split_parallel; -}; +#define ISL_BOUND_BERNSTEIN 0 +#define ISL_BOUND_RANGE 1 +int isl_options_set_bound(isl_ctx *ctx, int val); +int isl_options_get_bound(isl_ctx *ctx); -ISL_ARG_DECL(isl_options, struct isl_options, isl_options_args) +int isl_options_set_gbr_only_first(isl_ctx *ctx, int val); +int isl_options_get_gbr_only_first(isl_ctx *ctx); #if defined(__cplusplus) } diff --git a/include/isl/schedule.h b/include/isl/schedule.h index 20cb40b1..bbac080c 100644 --- a/include/isl/schedule.h +++ b/include/isl/schedule.h @@ -12,6 +12,9 @@ extern "C" { struct isl_schedule; typedef struct isl_schedule isl_schedule; +int isl_options_set_schedule_outer_zero_distance(isl_ctx *ctx, int val); +int isl_options_get_schedule_outer_zero_distance(isl_ctx *ctx); + __isl_give isl_schedule *isl_union_set_compute_schedule( __isl_take isl_union_set *domain, __isl_take isl_union_map *validity, diff --git a/isl_bernstein.c b/isl_bernstein.c index 43045fac..0e528e59 100644 --- a/isl_bernstein.c +++ b/isl_bernstein.c @@ -21,6 +21,7 @@ #include <isl_factorization.h> #include <isl_vertices_private.h> #include <isl_polynomial_private.h> +#include <isl_options_private.h> #include <isl_bernstein.h> struct bernstein_data { diff --git a/isl_bound.c b/isl_bound.c index a2fd0672..d9c10bc8 100644 --- a/isl_bound.c +++ b/isl_bound.c @@ -14,6 +14,7 @@ #include <isl_bernstein.h> #include <isl_range.h> #include <isl_polynomial_private.h> +#include <isl_options_private.h> /* Compute a bound on the polynomial defined over the parametric polytope * using either range propagation or bernstein expansion and diff --git a/isl_convex_hull.c b/isl_convex_hull.c index 20c0e2fc..a6e26b84 100644 --- a/isl_convex_hull.c +++ b/isl_convex_hull.c @@ -14,6 +14,7 @@ #include <isl_mat_private.h> #include <isl/set.h> #include <isl/seq.h> +#include <isl_options_private.h> #include "isl_equalities.h" #include "isl_tab.h" @@ -9,6 +9,7 @@ #include <isl_ctx_private.h> #include <isl/vec.h> +#include <isl/options.h> static struct isl_options *find_nested_options(struct isl_args *args, void *opt, struct isl_args *wanted) @@ -13,6 +13,7 @@ #include "isl_lp_piplib.h" #include <isl/seq.h> #include "isl_tab.h" +#include <isl_options_private.h> enum isl_lp_result isl_tab_solve_lp(struct isl_basic_map *bmap, int maximize, isl_int *f, isl_int denom, isl_int *opt, @@ -30,6 +30,7 @@ #include <isl_dim_map.h> #include <isl_local_space_private.h> #include <isl_aff_private.h> +#include <isl_options_private.h> static unsigned n(__isl_keep isl_space *dim, enum isl_dim_type type) { diff --git a/isl_options.c b/isl_options.c index 520a875a..9ea58299 100644 --- a/isl_options.c +++ b/isl_options.c @@ -12,7 +12,7 @@ #include <string.h> #include <isl/ctx.h> -#include <isl/options.h> +#include <isl_options_private.h> #include <isl/version.h> struct isl_arg_choice isl_lp_solver_choice[] = { @@ -131,3 +131,18 @@ ISL_ARG_VERSION(print_version) ISL_ARGS_END ISL_ARG_DEF(isl_options, struct isl_options, isl_options_args) + +ISL_ARG_CTX_DEF(isl_options, struct isl_options, isl_options_args) + +ISL_CTX_SET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, bound) +ISL_CTX_GET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args, bound) + +ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + gbr_only_first) +ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + gbr_only_first) + +ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_outer_zero_distance) +ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_outer_zero_distance) diff --git a/isl_options_private.h b/isl_options_private.h new file mode 100644 index 00000000..0c9137cd --- /dev/null +++ b/isl_options_private.h @@ -0,0 +1,53 @@ +#ifndef ISL_OPTIONS_PRIVATE_H +#define ISL_OPTIONS_PRIVATE_H + +#include <isl/options.h> + +struct isl_options { + #define ISL_LP_TAB 0 + #define ISL_LP_PIP 1 + unsigned lp_solver; + + #define ISL_ILP_GBR 0 + #define ISL_ILP_PIP 1 + unsigned ilp_solver; + + #define ISL_PIP_TAB 0 + #define ISL_PIP_PIP 1 + unsigned pip; + + #define ISL_CONTEXT_GBR 0 + #define ISL_CONTEXT_LEXMIN 1 + unsigned context; + + #define ISL_GBR_NEVER 0 + #define ISL_GBR_ONCE 1 + #define ISL_GBR_ALWAYS 2 + unsigned gbr; + unsigned gbr_only_first; + + #define ISL_CLOSURE_ISL 0 + #define ISL_CLOSURE_BOX 1 + unsigned closure; + + int bound; + + #define ISL_BERNSTEIN_FACTORS 1 + #define ISL_BERNSTEIN_INTERVALS 2 + int bernstein_recurse; + + int bernstein_triangulate; + + int pip_symmetry; + + #define ISL_CONVEX_HULL_WRAP 0 + #define ISL_CONVEX_HULL_FM 1 + int convex; + + int schedule_parametric; + int schedule_outer_zero_distance; + int schedule_maximize_band_depth; + int schedule_split_parallel; +}; + +#endif diff --git a/isl_sample.c b/isl_sample.c index c83fe572..ec63745e 100644 --- a/isl_sample.c +++ b/isl_sample.c @@ -19,6 +19,7 @@ #include "isl_basis_reduction.h" #include <isl_factorization.h> #include <isl_point_private.h> +#include <isl_options_private.h> static struct isl_vec *empty_sample(struct isl_basic_set *bset) { diff --git a/isl_schedule.c b/isl_schedule.c index b2792817..cc8da966 100644 --- a/isl_schedule.c +++ b/isl_schedule.c @@ -24,6 +24,7 @@ #include <isl_schedule_private.h> #include <isl_band_private.h> #include <isl_list_private.h> +#include <isl_options_private.h> /* * The scheduling algorithm implemented in this file was inspired by diff --git a/isl_tab_pip.c b/isl_tab_pip.c index 4d33b3be..9759dcf2 100644 --- a/isl_tab_pip.c +++ b/isl_tab_pip.c @@ -17,6 +17,7 @@ #include "isl_sample.h" #include <isl_mat_private.h> #include <isl_aff_private.h> +#include <isl_options_private.h> #include <isl_config.h> /* @@ -20,6 +20,7 @@ #include <isl/union_map.h> #include <isl_factorization.h> #include <isl/schedule.h> +#include <isl_options_private.h> static char *srcdir; diff --git a/isl_transitive_closure.c b/isl_transitive_closure.c index ef3e591d..20e020e3 100644 --- a/isl_transitive_closure.c +++ b/isl_transitive_closure.c @@ -16,6 +16,7 @@ #include <isl/lp.h> #include <isl/union_map.h> #include <isl_mat_private.h> +#include <isl_options_private.h> int isl_map_is_transitively_closed(__isl_keep isl_map *map) { @@ -20,6 +20,7 @@ #include <isl/ilp.h> #include <isl/printer.h> #include <isl_point_private.h> +#include <isl/options.h> /* The input of this program is the same as that of the "example" program * from the PipLib distribution, except that the "big parameter column" |