/* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay * Copyright 2012-2013 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * Copyright 2022 Cerebras Systems * * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite, * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt, * B.P. 105 - 78153 Le Chesnay, France * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA */ #include <assert.h> #include <stdio.h> #include <limits.h> #include <isl_ctx_private.h> #include <isl_map_private.h> #include <isl_aff_private.h> #include <isl_space_private.h> #include <isl/id.h> #include <isl/set.h> #include <isl/flow.h> #include <isl_constraint_private.h> #include <isl/polynomial.h> #include <isl/union_set.h> #include <isl/union_map.h> #include <isl_factorization.h> #include <isl/schedule.h> #include <isl/schedule_node.h> #include <isl_options_private.h> #include <isl_vertices_private.h> #include <isl/ast_build.h> #include <isl/val.h> #include <isl/ilp.h> #include <isl_ast_build_expr.h> #include <isl/options.h> #include "isl_srcdir.c" #define ARRAY_SIZE(array) … static char *get_filename(isl_ctx *ctx, const char *name, const char *suffix) { … } void test_parse_map(isl_ctx *ctx, const char *str) { … } int test_parse_map_equal(isl_ctx *ctx, const char *str, const char *str2) { … } void test_parse_pwqp(isl_ctx *ctx, const char *str) { … } static void test_parse_pwaff(isl_ctx *ctx, const char *str) { … } /* Check that we can read an isl_multi_val from "str" without errors. */ static int test_parse_multi_val(isl_ctx *ctx, const char *str) { … } /* String descriptions of multi piecewise affine expressions * that are used for testing printing and parsing. */ static const char *reparse_multi_pw_aff_tests[] = …; #undef BASE #define BASE … #include "check_reparse_templ.c" #include "check_reparse_test_templ.c" /* String descriptions that cannot be parsed * as multi piecewise affine expressions. */ static const char *parse_multi_pw_aff_fail_tests[] = …; #include "check_parse_fail_test_templ.c" /* String descriptions of piecewise multi affine expressions * that are used for testing printing and parsing. */ static const char *reparse_pw_multi_aff_tests[] = …; #undef BASE #define BASE … #include "check_reparse_templ.c" #include "check_reparse_test_templ.c" /* Test parsing of piecewise multi affine expressions by printing * the expressions and checking that parsing the output results * in the same expression. * Do this for an expression converted from a map with an output * dimension name that is equal to an automatically generated name, and * a set of expressions parsed from strings. */ static isl_stat test_parse_pma(isl_ctx *ctx) { … } /* String descriptions that cannot be parsed * as union piecewise multi affine expressions. */ static const char *parse_union_pw_multi_aff_fail_tests[] = …; #undef BASE #define BASE … #include "check_parse_fail_test_templ.c" /* Test parsing of union piecewise multi affine expressions. * * In particular, check some cases where parsing is supposed to fail. */ static isl_stat test_parse_upma(isl_ctx *ctx) { … } /* Test parsing of multi piecewise affine expressions by printing * the expressions and checking that parsing the output results * in the same expression. * Do this for a couple of manually constructed expressions, * an expression converted from a map with an output dimension name * that is equal to an automatically generated name, and * a set of expressions parsed from strings. * * Additionally, check some cases where parsing is supposed to fail. */ static int test_parse_mpa(isl_ctx *ctx) { … } /* String descriptions of multi union piecewise affine expressions * that are used for testing printing and parsing. */ static const char *reparse_multi_union_pw_aff_tests[] = …; #undef BASE #define BASE … #include "check_reparse_templ.c" #include "check_reparse_test_templ.c" /* Test parsing of multi union piecewise affine expressions by printing * the expressions and checking that parsing the output results * in the same expression. * Do this for a couple of manually constructed expressions and * a set of expressions parsed from strings. */ static int test_parse_mupa(isl_ctx *ctx) { … } /* Test parsing of multi expressions. */ static int test_parse_multi(isl_ctx *ctx) { … } /* Pairs of binary relation representations that should represent * the same binary relations. */ struct { … } parse_map_equal_tests[] = …; int test_parse(struct isl_ctx *ctx) { … } static int test_read(isl_ctx *ctx) { … } static int test_bounded(isl_ctx *ctx) { … } /* Construct the basic set { [i] : 5 <= i <= N } */ static int test_construction_1(isl_ctx *ctx) { … } /* Construct the basic set { [x] : -100 <= x <= 100 } * using isl_basic_set_{lower,upper}_bound_val and * check that it is equal the same basic set parsed from a string. */ static int test_construction_2(isl_ctx *ctx) { … } /* Basic tests for constructing basic sets. */ static int test_construction(isl_ctx *ctx) { … } static int test_dim(isl_ctx *ctx) { … } #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" /* Check that "val" is equal to the value described by "str". * If "str" is "NaN", then check for a NaN value explicitly. */ static isl_stat val_check_equal(__isl_keep isl_val *val, const char *str) { … } struct { … } val_un_tests[] = …; /* Perform some basic tests of unary operations on isl_val objects. */ static int test_un_val(isl_ctx *ctx) { … } struct { … } val_bin_op[] = …; struct { … } val_bin_tests[] = …; /* Perform some basic tests of binary operations on isl_val objects. */ static int test_bin_val(isl_ctx *ctx) { … } /* Perform some basic tests on isl_val objects. */ static int test_val(isl_ctx *ctx) { … } /* Sets described using existentially quantified variables that * can also be described without. */ static const char *elimination_tests[] = …; /* Check that redundant existentially quantified variables are * getting removed. */ static int test_elimination(isl_ctx *ctx) { … } static int test_div(isl_ctx *ctx) { … } void test_application_case(struct isl_ctx *ctx, const char *name) { … } static int test_application(isl_ctx *ctx) { … } void test_affine_hull_case(struct isl_ctx *ctx, const char *name) { … } /* Pairs of sets and the corresponding expected results of * isl_basic_set_recession_cone. */ struct { … } recession_cone_tests[] = …; /* Perform some basic isl_basic_set_recession_cone tests. */ static int test_recession_cone(struct isl_ctx *ctx) { … } int test_affine_hull(struct isl_ctx *ctx) { … } /* Test a special case of isl_set_plain_unshifted_simple_hull * where older versions of isl would include a redundant constraint * in the result. * Check that the result does not have any constraints. */ static isl_stat test_plain_unshifted_simple_hull_special(isl_ctx *ctx) { … } /* Inputs for simple hull tests, consisting of * the specific simple hull function, the input set and the expected result. */ struct { … } simple_hull_tests[] = …; /* Basic tests for various simple hull functions. */ static int test_various_simple_hull(isl_ctx *ctx) { … } static int test_simple_hull(struct isl_ctx *ctx) { … } /* Inputs for isl_set_get_simple_fixed_box_hull tests. * "set" is the input set. * "offset" is the expected box offset. * "size" is the expected box size. */ static struct { … } box_hull_tests[] = …; /* Perform basic isl_set_get_simple_fixed_box_hull tests. */ static int test_box_hull(struct isl_ctx *ctx) { … } void test_convex_hull_case(struct isl_ctx *ctx, const char *name) { … } struct { … } convex_hull_tests[] = …; static int test_convex_hull_algo(isl_ctx *ctx, int convex) { … } static int test_convex_hull(isl_ctx *ctx) { … } /* Check that computing the gist of "map" with respect to "context" * does not make any copy of "map" get marked empty. * Earlier versions of isl would end up doing that. */ static isl_stat test_gist_empty_pair(isl_ctx *ctx, const char *map, const char *context) { … } /* Check that computing a gist does not make any copy of the input * get marked empty. * Earlier versions of isl would end up doing that on some pairs of inputs. */ static isl_stat test_gist_empty(isl_ctx *ctx) { … } /* Inputs to isl_map_plain_gist_basic_map, along with the expected output. */ struct { … } plain_gist_tests[] = …; /* Basic tests for isl_map_plain_gist_basic_map. */ static int test_plain_gist(isl_ctx *ctx) { … } /* Inputs for isl_basic_set_gist tests that are expected to fail. */ struct { … } gist_fail_tests[] = …; /* Check that isl_basic_set_gist fails (gracefully) when expected. * In particular, the user should be able to recover from the failure. */ static isl_stat test_gist_fail(struct isl_ctx *ctx) { … } struct { … } gist_tests[] = …; /* Check that isl_set_gist behaves as expected. * * For the test cases in gist_tests, besides checking that the result * is as expected, also check that applying the gist operation does * not modify the input set (an earlier version of isl would do that) and * that the test case is consistent, i.e., that the gist has the same * intersection with the context as the input set. */ static int test_gist(struct isl_ctx *ctx) { … } int test_coalesce_set(isl_ctx *ctx, const char *str, int check_one) { … } /* Inputs for coalescing tests with unbounded wrapping. * "str" is a string representation of the input set. * "single_disjunct" is set if we expect the result to consist of * a single disjunct. */ struct { … } coalesce_unbounded_tests[] = …; /* Test the functionality of isl_set_coalesce with the bounded wrapping * option turned off. */ int test_coalesce_unbounded_wrapping(isl_ctx *ctx) { … } /* Inputs for coalescing tests. * "str" is a string representation of the input set. * "single_disjunct" is set if we expect the result to consist of * a single disjunct. */ struct { … } coalesce_tests[] = …; /* A specialized coalescing test case that would result * in a segmentation fault or a failed assertion in earlier versions of isl. */ static int test_coalesce_special(struct isl_ctx *ctx) { … } /* Check that the union of the basic sets described by "str1" and "str2" * can be coalesced and that the result is equal to the union. * The explicit call to isl_basic_set_union prevents the implicit * equality constraints in the basic maps from being detected prior * to the call to isl_set_coalesce, at least at the point * where this function was introduced. */ static isl_stat test_coalesce_union(isl_ctx *ctx, const char *str1, const char *str2) { … } /* A specialized coalescing test case that would result in an assertion * in an earlier version of isl. Use test_coalesce_union with * an explicit call to isl_basic_set_union to prevent the implicit * equality constraints in the first basic map from being detected prior * to the call to isl_set_coalesce, at least at the point * where this test case was introduced. */ static isl_stat test_coalesce_special2(struct isl_ctx *ctx) { … } /* Check that calling isl_set_coalesce does not leave other sets * that may share some information with the input to isl_set_coalesce * in an inconsistent state. * In particular, older versions of isl would modify all copies * of the basic sets in the isl_set_coalesce input in a way * that could leave them in an inconsistent state. * The result of printing any other set containing one of these * basic sets would then result in an invalid set description. */ static int test_coalesce_special3(isl_ctx *ctx) { … } /* Check that calling isl_set_coalesce on the intersection of * the sets described by "s1" and "s2" does not leave other sets * that may share some information with the input to isl_set_coalesce * in an inconsistent state. * In particular, when isl_set_coalesce detects equality constraints, * it does not immediately perform Gaussian elimination on them, * but then it needs to ensure that it is performed at some point. * The input set has implicit equality constraints in the first disjunct. * It is constructed as an intersection, because otherwise * those equality constraints would already be detected during parsing. */ static isl_stat test_coalesce_intersection(isl_ctx *ctx, const char *s1, const char *s2) { … } /* Check that calling isl_set_coalesce does not leave other sets * that may share some information with the input to isl_set_coalesce * in an inconsistent state, for the case where one disjunct * is a subset of the other. */ static isl_stat test_coalesce_special4(isl_ctx *ctx) { … } /* Check that calling isl_set_coalesce does not leave other sets * that may share some information with the input to isl_set_coalesce * in an inconsistent state, for the case where two disjuncts * can be fused. */ static isl_stat test_coalesce_special5(isl_ctx *ctx) { … } /* Check that calling isl_set_coalesce does not leave other sets * that may share some information with the input to isl_set_coalesce * in an inconsistent state, for the case where two disjuncts * can be fused and where both disjuncts have implicit equality constraints. */ static isl_stat test_coalesce_special6(isl_ctx *ctx) { … } /* A specialized coalescing test case that would result in an assertion failure * in an earlier version of isl. Use test_coalesce_union with * an explicit call to isl_basic_set_union to prevent the implicit * equality constraints in the basic maps from being detected prior * to the call to isl_set_coalesce, at least at the point * where this test case was introduced. */ static isl_stat test_coalesce_special7(isl_ctx *ctx) { … } /* A specialized coalescing test case that would result in a disjunct * getting dropped in an earlier version of isl. Use test_coalesce_union with * an explicit call to isl_basic_set_union to prevent the implicit * equality constraints in the basic maps from being detected prior * to the call to isl_set_coalesce, at least at the point * where this test case was introduced. */ static isl_stat test_coalesce_special8(isl_ctx *ctx) { … } /* Test the functionality of isl_set_coalesce. * That is, check that the output is always equal to the input * and in some cases that the result consists of a single disjunct. */ static int test_coalesce(struct isl_ctx *ctx) { … } /* Construct a representation of the graph on the right of Figure 1 * in "Computing the Transitive Closure of a Union of * Affine Integer Tuple Relations". */ static __isl_give isl_map *cocoa_fig_1_right_graph(isl_ctx *ctx) { … } /* Construct a representation of the power of the graph * on the right of Figure 1 in "Computing the Transitive Closure of * a Union of Affine Integer Tuple Relations". */ static __isl_give isl_map *cocoa_fig_1_right_power(isl_ctx *ctx) { … } /* Construct a representation of the transitive closure of the graph * on the right of Figure 1 in "Computing the Transitive Closure of * a Union of Affine Integer Tuple Relations". */ static __isl_give isl_map *cocoa_fig_1_right_tc(isl_ctx *ctx) { … } static int test_closure(isl_ctx *ctx) { … } /* Check that the actual result of a boolean operation is equal * to the expected result. */ static isl_stat check_bool(isl_ctx *ctx, isl_bool actual, isl_bool expected) { … } /* Test operations on isl_bool values. * * This tests: * * isl_bool_not * isl_bool_ok */ static int test_isl_bool(isl_ctx *ctx) { … } static int test_lex(struct isl_ctx *ctx) { … } /* Inputs for isl_map_lexmin tests. * "map" is the input and "lexmin" is the expected result. */ struct { … } lexmin_tests [] = …; static int test_lexmin(struct isl_ctx *ctx) { … } /* Inputs for isl_pw_multi_aff_max_multi_val tests. * "pma" is the input. * "res" is the expected result. */ static struct { … } opt_pw_tests[] = …; /* Perform basic isl_pw_multi_aff_max_multi_val tests. */ static isl_stat test_pw_max(struct isl_ctx *ctx) { … } /* A specialized isl_set_min_val test case that would return the wrong result * in earlier versions of isl. * The explicit call to isl_basic_set_union prevents the second basic set * from being determined to be empty prior to the call to isl_set_min_val, * at least at the point where this test case was introduced. */ static int test_min_special(isl_ctx *ctx) { … } /* A specialized isl_set_min_val test case that would return an error * in earlier versions of isl. */ static int test_min_special2(isl_ctx *ctx) { … } /* Check that the result of isl_set_min_multi_pw_aff * on the union of the sets with string descriptions "s1" and "s2" * consists of a single expression (on a single cell). */ static isl_stat check_single_expr_min(isl_ctx *ctx, const char *s1, const char *s2) { … } /* A specialized isl_set_min_multi_pw_aff test that checks * that the minimum of 2N and 3N for N >= 0 is represented * by a single expression, without splitting off the special case N = 0. * Do this for both orderings. */ static int test_min_mpa(isl_ctx *ctx) { … } struct { … } opt_tests[] = …; /* Perform basic isl_set_min_val and isl_set_max_val tests. * In particular, check the results on non-convex inputs. */ static int test_min(struct isl_ctx *ctx) { … } struct must_may { … }; static isl_stat collect_must_may(__isl_take isl_map *dep, int must, void *dep_user, void *user) { … } static int common_space(void *first, void *second) { … } static int map_is_equal(__isl_keep isl_map *map, const char *str) { … } static int map_check_equal(__isl_keep isl_map *map, const char *str) { … } /* Is "set" equal to the set described by "str"? */ static isl_bool set_is_equal(__isl_keep isl_set *set, const char *str) { … } /* Check that "set" is equal to the set described by "str". */ static isl_stat set_check_equal(__isl_keep isl_set *set, const char *str) { … } /* Is "uset" equal to the union set described by "str"? */ static isl_bool uset_is_equal(__isl_keep isl_union_set *uset, const char *str) { … } /* Check that "uset" is equal to the union set described by "str". */ static isl_stat uset_check_equal(__isl_keep isl_union_set *uset, const char *str) { … } static int test_dep(struct isl_ctx *ctx) { … } /* Check that the dependence analysis proceeds without errors. * Earlier versions of isl would break down during the analysis * due to the use of the wrong spaces. */ static int test_flow(isl_ctx *ctx) { … } struct { … } sv_tests[] = …; int test_sv(isl_ctx *ctx) { … } struct { … } bijective_tests[] = …; static int test_bijective(struct isl_ctx *ctx) { … } /* Inputs for isl_pw_qpolynomial_gist tests. * "pwqp" is the input, "set" is the context and "gist" is the expected result. */ struct { … } pwqp_gist_tests[] = …; /* Perform some basic isl_pw_qpolynomial_gist tests. */ static isl_stat test_pwqp_gist(isl_ctx *ctx) { … } /* Perform a basic isl_pw_qpolynomial_max test. */ static isl_stat test_pwqp_max(isl_ctx *ctx) { … } static int test_pwqp(struct isl_ctx *ctx) { … } static int test_split_periods(isl_ctx *ctx) { … } static int test_union(isl_ctx *ctx) { … } /* Inputs for basic isl_pw_qpolynomial_bound tests. * "type" is the type of bound that should be computed. * "poly" is a string representation of the input. * "bound" is a string representation of the expected result. * "tight" is set if the result is expected to be tight. */ static struct { … } bound_tests[] = …; /* Check that the bound computation can handle differences * in domain dimension names of the input polynomial and its domain. */ static isl_stat test_bound_space(isl_ctx *ctx) { … } /* Perform basic isl_pw_qpolynomial_bound tests. */ static int test_bound(isl_ctx *ctx) { … } /* isl_set is defined to isl_map internally, so the corresponding elements * are isl_basic_map objects. */ #undef EL_BASE #undef SET_BASE #define EL_BASE … #define SET_BASE … #include "isl_test_list_templ.c" #undef EL_BASE #undef SET_BASE #define EL_BASE … #define SET_BASE … #include "isl_test_list_templ.c" #undef EL_BASE #undef SET_BASE #define EL_BASE … #define SET_BASE … #include "isl_test_list_templ.c" #undef EL_BASE #undef SET_BASE #define EL_BASE … #define SET_BASE … #include "isl_test_list_templ.c" #undef EL_BASE #undef SET_BASE #define EL_BASE … #define SET_BASE … #include "isl_test_list_templ.c" /* Check that the conversion from isl objects to lists works as expected. */ static int test_get_list(isl_ctx *ctx) { … } static int test_lift(isl_ctx *ctx) { … } /* Check that isl_set_is_subset is not confused by identical * integer divisions. * The call to isl_set_normalize ensures that the equality constraints * a = b = 0 are discovered, turning e0 and e1 into identical * integer divisions. Any further simplification would remove * the duplicate integer divisions. */ static isl_stat test_subset_duplicate_integer_divisions(isl_ctx *ctx) { … } struct { … } subset_tests[] = …; static int test_subset(isl_ctx *ctx) { … } /* Perform a set subtraction with a set that has a non-obviously empty disjunct. * Older versions of isl would fail on such cases. */ static isl_stat test_subtract_empty(isl_ctx *ctx) { … } struct { … } subtract_domain_tests[] = …; static int test_subtract(isl_ctx *ctx) { … } /* Check that intersecting the empty basic set with another basic set * does not increase the number of constraints. In particular, * the empty basic set should maintain its canonical representation. */ static int test_intersect_1(isl_ctx *ctx) { … } /* Check that intersecting a set with itself does not cause * an explosion in the number of disjuncts. */ static isl_stat test_intersect_2(isl_ctx *ctx) { … } /* Perform some intersection tests. */ static int test_intersect(isl_ctx *ctx) { … } int test_factorize(isl_ctx *ctx) { … } static isl_stat check_injective(__isl_take isl_map *map, void *user) { … } int test_one_schedule(isl_ctx *ctx, const char *d, const char *w, const char *r, const char *s, int tilable, int parallel) { … } /* Compute a schedule for the given instance set, validity constraints, * proximity constraints and context and return a corresponding union map * representation. */ static __isl_give isl_union_map *compute_schedule_with_context(isl_ctx *ctx, const char *domain, const char *validity, const char *proximity, const char *context) { … } /* Compute a schedule for the given instance set, validity constraints and * proximity constraints and return a corresponding union map representation. */ static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, const char *domain, const char *validity, const char *proximity) { … } /* Check that a schedule can be constructed on the given domain * with the given validity and proximity constraints. */ static int test_has_schedule(isl_ctx *ctx, const char *domain, const char *validity, const char *proximity) { … } int test_special_schedule(isl_ctx *ctx, const char *domain, const char *validity, const char *proximity, const char *expected_sched) { … } /* Check that the schedule map is properly padded, i.e., that the range * lives in a single space. */ static int test_padded_schedule(isl_ctx *ctx) { … } /* Check that conditional validity constraints are also taken into * account across bands. * In particular, try to make sure that live ranges D[1,0]->C[2,1] and * D[2,0]->C[3,0] are not local in the outer band of the generated schedule * and then check that the adjacent order constraint C[2,1]->D[2,0] * is enforced by the rest of the schedule. */ static int test_special_conditional_schedule_constraints(isl_ctx *ctx) { … } /* Check that the test for violated conditional validity constraints * is not confused by domain compression. * In particular, earlier versions of isl would apply * a schedule on the compressed domains to the original domains, * resulting in a failure to detect that the default schedule * violates the conditional validity constraints. */ static int test_special_conditional_schedule_constraints_2(isl_ctx *ctx) { … } /* Input for testing of schedule construction based on * conditional constraints. * * domain is the iteration domain * flow are the flow dependences, which determine the validity and * proximity constraints * condition are the conditions on the conditional validity constraints * conditional_validity are the conditional validity constraints * outer_band_n is the expected number of members in the outer band */ struct { … } live_range_tests[] = …; /* Test schedule construction based on conditional constraints. * In particular, check the number of members in the outer band node * as an indication of whether tiling is possible or not. */ static int test_conditional_schedule_constraints(isl_ctx *ctx) { … } /* Check that the schedule computed for the given instance set and * dependence relation strongly satisfies the dependences. * In particular, check that no instance is scheduled before * or together with an instance on which it depends. * Earlier versions of isl would produce a schedule that * only weakly satisfies the dependences. */ static int test_strongly_satisfying_schedule(isl_ctx *ctx) { … } /* Compute a schedule for input where the instance set constraints * conflict with the context constraints. * Earlier versions of isl did not properly handle this situation. */ static int test_conflicting_context_schedule(isl_ctx *ctx) { … } /* Check that a set of schedule constraints that only allow for * a coalescing schedule still produces a schedule even if the user * request a non-coalescing schedule. Earlier versions of isl * would not handle this case correctly. */ static int test_coalescing_schedule(isl_ctx *ctx) { … } /* Check that the scheduler does not perform any needless * compound skewing. Earlier versions of isl would compute * schedules in terms of transformed schedule coefficients and * would not accurately keep track of the sum of the original * schedule coefficients. It could then produce the schedule * S[t,i,j,k] -> [t, 2t + i, 2t + i + j, 2t + i + j + k] * for the input below instead of the schedule below. */ static int test_skewing_schedule(isl_ctx *ctx) { … } int test_schedule(isl_ctx *ctx) { … } /* Perform scheduling tests using the whole component scheduler. */ static int test_schedule_whole(isl_ctx *ctx) { … } /* Perform scheduling tests using the incremental scheduler. */ static int test_schedule_incremental(isl_ctx *ctx) { … } int test_plain_injective(isl_ctx *ctx, const char *str, int injective) { … } int test_injective(isl_ctx *ctx) { … } #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" /* Basic tests on isl_union_pw_aff. * * In particular, check that isl_union_pw_aff_aff_on_domain * aligns the parameters of the input objects and * that isl_union_pw_aff_param_on_domain_id properly * introduces the parameter. */ static int test_upa(isl_ctx *ctx) { … } struct { … } aff_bin_op[] = …; struct { … } aff_bin_tests[] = …; /* Perform some basic tests of binary operations on isl_aff objects. */ static int test_bin_aff(isl_ctx *ctx) { … } struct { … } pw_aff_bin_op[] = …; /* Inputs for binary isl_pw_aff operation tests. * "arg1" and "arg2" are the two arguments, "op" identifies the operation * defined by pw_aff_bin_op, and "res" is the expected result. */ struct { … } pw_aff_bin_tests[] = …; /* Perform some basic tests of binary operations on isl_pw_aff objects. */ static int test_bin_pw_aff(isl_ctx *ctx) { … } /* Inputs for basic tests of test operations on * isl_union_pw_multi_aff objects. * "fn" is the function that is being tested. * "arg" is a string description of the input. * "res" is the expected result. */ static struct { … } upma_test_tests[] = …; /* Perform some basic tests of test operations on * isl_union_pw_multi_aff objects. */ static isl_stat test_upma_test(isl_ctx *ctx) { … } struct { … } upma_bin_tests[] = …; /* Perform some basic tests of binary operations on * isl_union_pw_multi_aff objects. */ static int test_bin_upma(isl_ctx *ctx) { … } struct { … } upma_bin_fail_tests[] = …; /* Perform some basic tests of binary operations on * isl_union_pw_multi_aff objects that are expected to fail. */ static int test_bin_upma_fail(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_union_pw_multi_aff and isl_union_set objects. * "fn" is the function that is being tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } upma_uset_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_union_pw_multi_aff and isl_union_set objects. */ static isl_stat test_upma_uset(isl_ctx *ctx) { … } /* Inputs for basic tests of unary operations on isl_multi_pw_aff objects. * "fn" is the function that is tested. * "arg" is a string description of the input. * "res" is a string description of the expected result. */ struct { … } mpa_un_tests[] = …; /* Perform some basic tests of unary operations on isl_multi_pw_aff objects. */ static int test_un_mpa(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on isl_multi_pw_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mpa_bin_tests[] = …; /* Perform some basic tests of binary operations on isl_multi_pw_aff objects. */ static int test_bin_mpa(isl_ctx *ctx) { … } /* Inputs for basic tests of unary operations on * isl_multi_union_pw_aff objects. * "fn" is the function that is tested. * "arg" is a string description of the input. * "res" is a string description of the expected result. */ struct { … } mupa_un_tests[] = …; /* Perform some basic tests of unary operations on * isl_multi_union_pw_aff objects. */ static int test_un_mupa(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * isl_multi_union_pw_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_bin_tests[] = …; /* Perform some basic tests of binary operations on * isl_multi_union_pw_aff objects. */ static int test_bin_mupa(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_set objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_set_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_set objects. */ static int test_mupa_set(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_union_set objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_uset_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_union_set objects. */ static int test_mupa_uset(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_multi_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_ma_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_multi_aff objects. */ static int test_mupa_ma(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_pw_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_pa_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_pw_aff objects. */ static int test_mupa_pa(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_pw_multi_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_pma_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_pw_multi_aff objects. */ static int test_mupa_pma(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_union_pw_multi_aff objects. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } mupa_upma_tests[] = …; /* Perform some basic tests of binary operations on * pairs of isl_multi_union_pw_aff and isl_union_pw_multi_aff objects. */ static int test_mupa_upma(isl_ctx *ctx) { … } /* Check that the input tuple of an isl_aff can be set properly. */ static isl_stat test_aff_set_tuple_id(isl_ctx *ctx) { … } /* Check that affine expressions get normalized on addition/subtraction. * In particular, check that (final) unused integer divisions get removed * such that an expression derived from expressions with integer divisions * is found to be obviously equal to one that is created directly. */ static isl_stat test_aff_normalize(isl_ctx *ctx) { … } int test_aff(isl_ctx *ctx) { … } /* Inputs for isl_set_bind tests. * "set" is the input set. * "tuple" is the binding tuple. * "res" is the expected result. */ static struct { … } bind_set_tests[] = …; /* Perform basic isl_set_bind tests. */ static isl_stat test_bind_set(isl_ctx *ctx) { … } /* Inputs for isl_map_bind_domain tests. * "map" is the input map. * "tuple" is the binding tuple. * "res" is the expected result. */ struct { … } bind_map_domain_tests[] = …; /* Perform basic isl_map_bind_domain tests. */ static isl_stat test_bind_map_domain(isl_ctx *ctx) { … } /* Inputs for isl_union_map_bind_range tests. * "map" is the input union map. * "tuple" is the binding tuple. * "res" is the expected result. */ struct { … } bind_umap_range_tests[] = …; /* Perform basic isl_union_map_bind_range tests. */ static isl_stat test_bind_umap_range(isl_ctx *ctx) { … } /* Inputs for isl_pw_multi_aff_bind_domain tests. * "pma" is the input expression. * "tuple" is the binding tuple. * "res" is the expected result. */ struct { … } bind_pma_domain_tests[] = …; /* Perform basic isl_pw_multi_aff_bind_domain tests. */ static isl_stat test_bind_pma_domain(isl_ctx *ctx) { … } /* Inputs for isl_pw_multi_aff_bind_domain_wrapped_domain tests. * "pma" is the input expression. * "tuple" is the binding tuple. * "res" is the expected result. */ struct { … } bind_pma_domain_wrapped_tests[] = …; /* Perform basic isl_pw_multi_aff_bind_domain_wrapped_domain tests. */ static isl_stat test_bind_pma_domain_wrapped(isl_ctx *ctx) { … } /* Inputs for isl_aff_bind_id tests. * "aff" is the input expression. * "id" is the binding id. * "res" is the expected result. */ static struct { … } bind_aff_tests[] = …; /* Perform basic isl_aff_bind_id tests. */ static isl_stat test_bind_aff(isl_ctx *ctx) { … } /* Inputs for isl_pw_aff_bind_id tests. * "pa" is the input expression. * "id" is the binding id. * "res" is the expected result. */ static struct { … } bind_pa_tests[] = …; /* Perform basic isl_pw_aff_bind_id tests. */ static isl_stat test_bind_pa(isl_ctx *ctx) { … } /* Inputs for isl_multi_union_pw_aff_bind tests. * "mupa" is the input expression. * "tuple" is the binding tuple. * "res" is the expected result. */ static struct { … } bind_mupa_tests[] = …; /* Perform basic isl_multi_union_pw_aff_bind tests. */ static isl_stat test_bind_mupa(isl_ctx *ctx) { … } /* Perform tests that reinterpret dimensions as parameters. */ static int test_bind(isl_ctx *ctx) { … } /* Inputs for isl_set_unbind_params tests. * "set" is the input parameter domain. * "tuple" is the tuple of the constructed set. * "res" is the expected result. */ struct { … } unbind_set_tests[] = …; /* Perform basic isl_set_unbind_params tests. */ static isl_stat test_unbind_set(isl_ctx *ctx) { … } /* Inputs for isl_aff_unbind_params_insert_domain tests. * "aff" is the input affine expression defined over a parameter domain. * "tuple" is the tuple of the domain that gets introduced. * "res" is the expected result. */ struct { … } unbind_aff_tests[] = …; /* Perform basic isl_aff_unbind_params_insert_domain tests. */ static isl_stat test_unbind_aff(isl_ctx *ctx) { … } /* Inputs for isl_multi_aff_unbind_params_insert_domain tests. * "ma" is the input multi affine expression defined over a parameter domain. * "tuple" is the tuple of the domain that gets introduced. * "res" is the expected result. */ static struct { … } unbind_multi_aff_tests[] = …; /* Perform basic isl_multi_aff_unbind_params_insert_domain tests. */ static isl_stat test_unbind_multi_aff(isl_ctx *ctx) { … } /* Perform tests that reinterpret parameters. */ static int test_unbind(isl_ctx *ctx) { … } /* Check that "pa" consists of a single expression. */ static int check_single_piece(isl_ctx *ctx, __isl_take isl_pw_aff *pa) { … } /* Check that the computation below results in a single expression. * One or two expressions may result depending on which constraint * ends up being considered as redundant with respect to the other * constraints after the projection that is performed internally * by isl_set_dim_min. */ static int test_dim_max_1(isl_ctx *ctx) { … } /* Check that the computation below results in a single expression. * The PIP problem corresponding to these constraints has a row * that causes a split of the solution domain. The solver should * first pick rows that split off empty parts such that the actual * solution domain does not get split. * Note that the description contains some redundant constraints. * If these constraints get removed first, then the row mentioned * above does not appear in the PIP problem. */ static int test_dim_max_2(isl_ctx *ctx) { … } int test_dim_max(isl_ctx *ctx) { … } /* Basic test for isl_pw_multi_aff_product. * * Check that multiple pieces are properly handled. */ static int test_product_pma(isl_ctx *ctx) { … } int test_product(isl_ctx *ctx) { … } /* Check that two sets are not considered disjoint just because * they have a different set of (named) parameters. */ static int test_disjoint(isl_ctx *ctx) { … } /* Inputs for isl_pw_multi_aff_is_equal tests. * "f1" and "f2" are the two function that need to be compared. * "equal" is the expected result. */ struct { … } pma_equal_tests[] = …; int test_equal(isl_ctx *ctx) { … } static int test_plain_fixed(isl_ctx *ctx, __isl_take isl_map *map, enum isl_dim_type type, unsigned pos, int fixed) { … } int test_fixed(isl_ctx *ctx) { … } struct isl_vertices_test_data { … } vertices_tests[] = …; /* Check that "vertex" corresponds to one of the vertices in data->vertex. */ static isl_stat find_vertex(__isl_take isl_vertex *vertex, void *user) { … } int test_vertices(isl_ctx *ctx) { … } /* Inputs for basic tests of unary operations on isl_union_map. * "fn" is the function that is being tested. * "arg" is a string description of the input. * "res" is a string description of the expected result. */ static struct { … } umap_un_tests[] = …; /* Perform basic tests of unary operations on isl_union_map. */ static isl_stat test_un_union_map(isl_ctx *ctx) { … } /* Inputs for basic tests of binary operations on isl_union_map. * "fn" is the function that is being tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ static struct { … } umap_bin_tests[] = …; /* Perform basic tests of binary operations on isl_union_map. */ static isl_stat test_bin_union_map(isl_ctx *ctx) { … } /* Check that isl_union_set_contains finds space independently * of the parameters. */ static isl_stat test_union_set_contains(isl_ctx *ctx) { … } /* Perform basic tests of operations on isl_union_map or isl_union_set. */ static int test_union_map(isl_ctx *ctx) { … } #undef BASE #define BASE … #include "isl_test_plain_equal_templ.c" /* Check that the result of applying "fn" to "a" and "b" * in (obviously) equal to "res". */ static isl_stat test_union_pw_op(isl_ctx *ctx, const char *a, const char *b, __isl_give isl_union_pw_qpolynomial *(*fn)( __isl_take isl_union_pw_qpolynomial *upwqp1, __isl_take isl_union_pw_qpolynomial *upwqp2), const char *res) { … } int test_union_pw(isl_ctx *ctx) { … } /* Inputs for basic tests of functions that select * subparts of the domain of an isl_multi_union_pw_aff. * "fn" is the function that is tested. * "arg" is a string description of the input. * "res" is a string description of the expected result. */ struct { … } un_locus_tests[] = …; /* Perform some basic tests of functions that select * subparts of the domain of an isl_multi_union_pw_aff. */ static int test_un_locus(isl_ctx *ctx) { … } /* Inputs for basic tests of functions that select * subparts of an isl_union_map based on a relation * specified by an isl_multi_union_pw_aff. * "fn" is the function that is tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ struct { … } bin_locus_tests[] = …; /* Perform some basic tests of functions that select * subparts of an isl_union_map based on a relation * specified by an isl_multi_union_pw_aff. */ static int test_bin_locus(isl_ctx *ctx) { … } /* Inputs for basic tests of functions that determine * the part of the domain where two isl_multi_aff objects * related to each other in a specific way. * "fn" is the function that is being tested. * "arg1" and "arg2" are string descriptions of the inputs. * "res" is a string description of the expected result. */ static struct { … } bin_locus_ma_tests[] = …; /* Perform some basic tests of functions that determine * the part of the domain where two isl_multi_aff objects * related to each other in a specific way. */ static isl_stat test_bin_locus_ma(isl_ctx *ctx) { … } /* Perform basic locus tests. */ static int test_locus(isl_ctx *ctx) { … } /* Test that isl_union_pw_qpolynomial_eval picks up the function * defined over the correct domain space. */ static int test_eval_1(isl_ctx *ctx) { … } /* Check that isl_qpolynomial_eval handles getting called on a void point. */ static int test_eval_2(isl_ctx *ctx) { … } /* Check that a polynomial (without local variables) can be evaluated * in a rational point. */ static isl_stat test_eval_3(isl_ctx *ctx) { … } /* Inputs for isl_pw_aff_eval test. * "f" is the affine function. * "p" is the point where the function should be evaluated. * "res" is the expected result. */ struct { … } aff_eval_tests[] = …; /* Perform basic isl_pw_aff_eval tests. */ static int test_eval_aff(isl_ctx *ctx) { … } /* Perform basic evaluation tests. */ static int test_eval(isl_ctx *ctx) { … } /* Descriptions of sets that are tested for reparsing after printing. */ const char *output_tests[] = …; /* Check that printing a set and reparsing a set from the printed output * results in the same set. */ static int test_output_set(isl_ctx *ctx) { … } /* Check that an isl_multi_aff is printed using a consistent space. */ static isl_stat test_output_ma(isl_ctx *ctx) { … } /* Check that an isl_multi_pw_aff is printed using a consistent space. */ static isl_stat test_output_mpa(isl_ctx *ctx) { … } int test_output(isl_ctx *ctx) { … } int test_sample(isl_ctx *ctx) { … } /* Perform a projection on a basic set that is known to be empty * but that has not been assigned a canonical representation. * Earlier versions of isl would run into a stack overflow * on this example. */ static int test_empty_projection(isl_ctx *ctx) { … } int test_slice(isl_ctx *ctx) { … } int test_eliminate(isl_ctx *ctx) { … } /* Check basic functionality of isl_map_deltas_map. */ static int test_deltas_map(isl_ctx *ctx) { … } /* Check that isl_set_dim_residue_class detects that the values of j * in the set below are all odd and that it does not detect any spurious * strides. */ static int test_residue_class(isl_ctx *ctx) { … } static int test_align_parameters_1(isl_ctx *ctx) { … } /* Check the isl_multi_*_from_*_list operation in case inputs * have unaligned parameters. * In particular, older versions of isl would simply fail * (without printing any error message). */ static isl_stat test_align_parameters_2(isl_ctx *ctx) { … } /* Perform basic parameter alignment tests. */ static int test_align_parameters(isl_ctx *ctx) { … } /* Check that isl_*_drop_unused_params actually drops the unused parameters * by comparing the result using isl_*_plain_is_equal. * Note that this assumes that isl_*_plain_is_equal does not consider * objects that only differ by unused parameters to be equal. */ int test_drop_unused_parameters(isl_ctx *ctx) { … } static int test_list(isl_ctx *ctx) { … } /* Check the conversion from an isl_multi_aff to an isl_basic_set. */ static isl_stat test_ma_conversion(isl_ctx *ctx) { … } const char *set_conversion_tests[] = …; /* Check that converting from isl_set to isl_pw_multi_aff and back * to isl_set produces the original isl_set. */ static int test_set_conversion(isl_ctx *ctx) { … } const char *conversion_tests[] = …; /* Check that converting from isl_map to isl_pw_multi_aff and back * to isl_map produces the original isl_map. */ static int test_map_conversion(isl_ctx *ctx) { … } /* Descriptions of isl_pw_multi_aff objects for testing conversion * to isl_multi_pw_aff and back. */ const char *mpa_conversion_tests[] = …; /* Check that conversion from isl_pw_multi_aff to isl_multi_pw_aff and * back to isl_pw_multi_aff preserves the original meaning. */ static int test_mpa_conversion(isl_ctx *ctx) { … } /* Descriptions of union maps that should be convertible * to an isl_multi_union_pw_aff. */ const char *umap_mupa_conversion_tests[] = …; /* Check that converting from isl_union_map to isl_multi_union_pw_aff and back * to isl_union_map produces the original isl_union_map. */ static int test_union_map_mupa_conversion(isl_ctx *ctx) { … } static int test_conversion(isl_ctx *ctx) { … } /* Check that isl_basic_map_curry does not modify input. */ static int test_curry(isl_ctx *ctx) { … } struct { … } pullback_tests[] = …; static int test_pullback(isl_ctx *ctx) { … } /* Check that negation is printed correctly and that equal expressions * are correctly identified. */ static int test_ast(isl_ctx *ctx) { … } /* Check that isl_ast_build_expr_from_set returns a valid expression * for an empty set. Note that isl_ast_build_expr_from_set getting * called on an empty set probably indicates a bug in the caller. */ static int test_ast_build(isl_ctx *ctx) { … } /* Internal data structure for before_for and after_for callbacks. * * depth is the current depth * before is the number of times before_for has been called * after is the number of times after_for has been called */ struct isl_test_codegen_data { … }; /* This function is called before each for loop in the AST generated * from test_ast_gen1. * * Increment the number of calls and the depth. * Check that the space returned by isl_ast_build_get_schedule_space * matches the target space of the schedule returned by * isl_ast_build_get_schedule. * Return an isl_id that is checked by the corresponding call * to after_for. */ static __isl_give isl_id *before_for(__isl_keep isl_ast_build *build, void *user) { … } /* This function is called after each for loop in the AST generated * from test_ast_gen1. * * Increment the number of calls and decrement the depth. * Check that the annotation attached to the node matches * the isl_id returned by the corresponding call to before_for. */ static __isl_give isl_ast_node *after_for(__isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user) { … } /* This function is called after node in the AST generated * from test_ast_gen1. * * Increment the count in "user" if this is a for node and * return true to indicate that descendant should also be visited. */ static isl_bool count_for(__isl_keep isl_ast_node *node, void *user) { … } /* If "node" is a block node, then replace it by its first child. */ static __isl_give isl_ast_node *select_first(__isl_take isl_ast_node *node, void *user) { … } /* Check that the before_each_for and after_each_for callbacks * are called for each for loop in the generated code, * that they are called in the right order and that the isl_id * returned from the before_each_for callback is attached to * the isl_ast_node passed to the corresponding after_each_for call. * * Additionally, check the basic functionality of * isl_ast_node_foreach_descendant_top_down by counting the number * of for loops in the resulting AST, * as well as that of isl_ast_node_map_descendant_bottom_up * by replacing the block node by its first child and * counting the number of for loops again. */ static isl_stat test_ast_gen1(isl_ctx *ctx) { … } /* Check that the AST generator handles domains that are integrally disjoint * but not rationally disjoint. */ static int test_ast_gen2(isl_ctx *ctx) { … } /* Increment *user on each call. */ static __isl_give isl_ast_node *count_domains(__isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user) { … } /* Test that unrolling tries to minimize the number of instances. * In particular, for the schedule given below, make sure it generates * 3 nodes (rather than 101). */ static int test_ast_gen3(isl_ctx *ctx) { … } /* Check that if the ast_build_exploit_nested_bounds options is set, * we do not get an outer if node in the generated AST, * while we do get such an outer if node if the options is not set. */ static int test_ast_gen4(isl_ctx *ctx) { … } /* This function is called for each leaf in the AST generated * from test_ast_gen5. * * We finalize the AST generation by extending the outer schedule * with a zero-dimensional schedule. If this results in any for loops, * then this means that we did not pass along enough information * about the outer schedule to the inner AST generation. */ static __isl_give isl_ast_node *create_leaf(__isl_take isl_ast_build *build, void *user) { … } /* Check that we do not lose any information when going back and * forth between internal and external schedule. * * In particular, we create an AST where we unroll the only * non-constant dimension in the schedule. We therefore do * not expect any for loops in the AST. However, older versions * of isl would not pass along enough information about the outer * schedule when performing an inner code generation from a create_leaf * callback, resulting in the inner code generation producing a for loop. */ static int test_ast_gen5(isl_ctx *ctx) { … } /* Check that the expression * * [n] -> { [n/2] : n <= 0 and n % 2 = 0; [0] : n > 0 } * * is not combined into * * min(n/2, 0) * * as this would result in n/2 being evaluated in parts of * the definition domain where n is not a multiple of 2. */ static int test_ast_expr(isl_ctx *ctx) { … } static int test_ast_gen(isl_ctx *ctx) { … } /* Check if dropping output dimensions from an isl_pw_multi_aff * works properly. */ static int test_pw_multi_aff(isl_ctx *ctx) { … } /* Check that we can properly parse multi piecewise affine expressions * where the piecewise affine expressions have different domains. */ static int test_multi_pw_aff_1(isl_ctx *ctx) { … } /* Check that the dimensions in the explicit domain * of a multi piecewise affine expression are properly * taken into account. */ static int test_multi_pw_aff_2(isl_ctx *ctx) { … } /* Check that isl_multi_union_pw_aff_multi_val_on_domain * sets the explicit domain of a zero-dimensional result, * such that it can be converted to an isl_union_map. */ static isl_stat test_multi_pw_aff_3(isl_ctx *ctx) { … } /* String descriptions of boxes that * are used for reconstructing box maps from their lower and upper bounds. */ static const char *multi_pw_aff_box_tests[] = …; /* Check that map representations of boxes can be reconstructed * from their lower and upper bounds. */ static isl_stat test_multi_pw_aff_box(isl_ctx *ctx) { … } /* Perform some tests on multi piecewise affine expressions. */ static int test_multi_pw_aff(isl_ctx *ctx) { … } /* This is a regression test for a bug where isl_basic_map_simplify * would end up in an infinite loop. In particular, we construct * an empty basic set that is not obviously empty. * isl_basic_set_is_empty marks the basic set as empty. * After projecting out i3, the variable can be dropped completely, * but isl_basic_map_simplify refrains from doing so if the basic set * is empty and would end up in an infinite loop if it didn't test * explicitly for empty basic maps in the outer loop. */ static int test_simplify_1(isl_ctx *ctx) { … } /* Check that the equality in the set description below * is simplified away. */ static int test_simplify_2(isl_ctx *ctx) { … } /* Some simplification tests. */ static int test_simplify(isl_ctx *ctx) { … } /* This is a regression test for a bug where isl_tab_basic_map_partial_lexopt * with gbr context would fail to disable the use of the shifted tableau * when transferring equalities for the input to the context, resulting * in invalid sample values. */ static int test_partial_lexmin(isl_ctx *ctx) { … } /* Check that the variable compression performed on the existentially * quantified variables inside isl_basic_set_compute_divs is not confused * by the implicit equalities among the parameters. */ static int test_compute_divs(isl_ctx *ctx) { … } /* Check that isl_schedule_get_map is not confused by a schedule tree * with divergent filter node parameters, as can result from a call * to isl_schedule_intersect_domain. */ static int test_schedule_tree(isl_ctx *ctx) { … } /* Check that a zero-dimensional prefix schedule keeps track * of the domain and outer filters. */ static int test_schedule_tree_prefix(isl_ctx *ctx) { … } /* Check that the reaching domain elements and the prefix schedule * at a leaf node are the same before and after grouping. */ static int test_schedule_tree_group_1(isl_ctx *ctx) { … } /* Check that we can have nested groupings and that the union map * schedule representation is the same before and after the grouping. * Note that after the grouping, the union map representation contains * the domain constraints from the ranges of the expansion nodes, * while they are missing from the union map representation of * the tree without expansion nodes. * * Also check that the global expansion is as expected. */ static int test_schedule_tree_group_2(isl_ctx *ctx) { … } /* Some tests for the isl_schedule_node_group function. */ static int test_schedule_tree_group(isl_ctx *ctx) { … } struct { … } coef_tests[] = …; struct { … } sol_tests[] = …; /* Test the basic functionality of isl_basic_set_coefficients and * isl_basic_set_solutions. */ static int test_dual(isl_ctx *ctx) { … } struct { … } tile_tests[] = …; /* Basic tiling tests. Create a schedule tree with a domain and a band node, * tile the band and then check if the tile and point bands have the * expected partial schedule. */ static int test_tile(isl_ctx *ctx) { … } /* Check that the domain hash of a space is equal to the hash * of the domain of the space, both ignoring parameters. */ static int test_domain_hash(isl_ctx *ctx) { … } /* Check that a universe basic set that is not obviously equal to the universe * is still recognized as being equal to the universe. */ static int test_universe(isl_ctx *ctx) { … } /* Sets for which chambers are computed and checked. */ const char *chambers_tests[] = …; /* Add the domain of "cell" to "cells". */ static isl_stat add_cell(__isl_take isl_cell *cell, void *user) { … } /* Check that the elements of "list" are pairwise disjoint. */ static isl_stat check_pairwise_disjoint(__isl_keep isl_basic_set_list *list) { … } /* Check that the chambers computed by isl_vertices_foreach_disjoint_cell * are pairwise disjoint. */ static int test_chambers(isl_ctx *ctx) { … } struct { … } tests [] = …; int main(int argc, char **argv) { … }