Lines Matching refs:isl

29 void test_pointer(isl::ctx ctx)  in test_pointer()
32 isl::set empty = isl::manage(c_empty); in test_pointer()
61 void test_constructors(isl::ctx ctx) in test_constructors()
63 isl::val null; in test_constructors()
66 isl::val zero_from_str = isl::val(ctx, "0"); in test_constructors()
69 isl::val zero_int_con = isl::val(ctx, 0); in test_constructors()
72 isl::val zero_static_con = isl::val::zero(ctx); in test_constructors()
75 isl::basic_set bs(ctx, "{ [1] }"); in test_constructors()
76 isl::set result(ctx, "{ [1] }"); in test_constructors()
77 isl::set s = bs; in test_constructors()
79 isl::set s2(bs); in test_constructors()
82 isl::union_set us(ctx, "{ A[1]; B[2, 3] }"); in test_constructors()
83 isl::union_set empty = isl::union_set::empty(ctx); in test_constructors()
91 void test_parameters_int(isl::ctx ctx) in test_parameters_int()
93 isl::val long_max_str(ctx, std::to_string(LONG_MAX)); in test_parameters_int()
94 isl::val long_max_int(ctx, LONG_MAX); in test_parameters_int()
97 isl::val long_min_str(ctx, std::to_string(LONG_MIN)); in test_parameters_int()
98 isl::val long_min_int(ctx, LONG_MIN); in test_parameters_int()
101 isl::val long_zero_str = isl::val(ctx, std::to_string(0)); in test_parameters_int()
102 isl::val long_zero_int = isl::val(ctx, 0); in test_parameters_int()
114 void test_parameters_obj(isl::ctx ctx) in test_parameters_obj()
116 isl::set a(ctx, "{ [0] }"); in test_parameters_obj()
117 isl::set b(ctx, "{ [1] }"); in test_parameters_obj()
118 isl::set c(ctx, "{ [2] }"); in test_parameters_obj()
119 isl::set expected(ctx, "{ [i] : 0 <= i <= 2 }"); in test_parameters_obj()
121 isl::set tmp = a.unite(b); in test_parameters_obj()
122 isl::set res_lvalue_param = tmp.unite(c); in test_parameters_obj()
125 isl::set res_rvalue_param = a.unite(b).unite(c); in test_parameters_obj()
128 isl::basic_set a2(ctx, "{ [0] }"); in test_parameters_obj()
131 isl::val two(ctx, 2); in test_parameters_obj()
132 isl::val half(ctx, "1/2"); in test_parameters_obj()
133 isl::val res_only_this_param = two.inv(); in test_parameters_obj()
141 void test_parameters(isl::ctx ctx) in test_parameters()
152 void test_return_obj(isl::ctx ctx) in test_return_obj()
154 isl::val one(ctx, "1"); in test_return_obj()
155 isl::val two(ctx, "2"); in test_return_obj()
156 isl::val three(ctx, "3"); in test_return_obj()
158 isl::val res = one.add(two); in test_return_obj()
165 void test_return_int(isl::ctx ctx) in test_return_int()
167 isl::val one(ctx, "1"); in test_return_int()
168 isl::val neg_one(ctx, "-1"); in test_return_int()
169 isl::val zero(ctx, "0"); in test_return_int()
179 void test_return_string(isl::ctx ctx) in test_return_string()
181 isl::set context(ctx, "[n] -> { : }"); in test_return_string()
182 isl::ast_build build = isl::ast_build::from_context(context); in test_return_string()
183 isl::pw_aff pw_aff(ctx, "[n] -> { [n] }"); in test_return_string()
184 isl::set set(ctx, "[n] -> { : n >= 0 }"); in test_return_string()
186 isl::ast_expr expr = build.expr_from(pw_aff); in test_return_string()
198 static void test_every_generic(isl::ctx ctx) in test_every_generic()
200 isl::union_set us(ctx, "{ A[i]; B[j] }"); in test_every_generic()
202 auto is_empty = [] (isl::set s) { in test_every_generic()
207 auto is_non_empty = [] (isl::set s) { in test_every_generic()
212 auto in_A = [] (isl::set s) { in test_every_generic()
213 return s.is_subset(isl::set(s.ctx(), "{ A[x] }")); in test_every_generic()
217 auto not_in_A = [] (isl::set s) { in test_every_generic()
218 return !s.is_subset(isl::set(s.ctx(), "{ A[x] }")); in test_every_generic()
225 static void test_space(isl::ctx ctx) in test_space()
227 isl::space unit = isl::space::unit(ctx); in test_space()
228 isl::space set_space = unit.add_named_tuple("A", 3); in test_space()
229 isl::space map_space = set_space.add_named_tuple("B", 2); in test_space()
231 isl::set set = isl::set::universe(set_space); in test_space()
232 isl::map map = isl::map::universe(map_space); in test_space()
233 assert(IS_TRUE(set.is_equal(isl::set(ctx, "{ A[*,*,*] }")))); in test_space()
234 assert(IS_TRUE(map.is_equal(isl::map(ctx, "{ A[*,*,*] -> B[*,*] }")))); in test_space()
241 static isl::schedule construct_schedule_tree(isl::ctx ctx) in construct_schedule_tree()
243 isl::union_set A(ctx, "{ A[i] : 0 <= i < 10 }"); in construct_schedule_tree()
244 isl::union_set B(ctx, "{ B[i] : 0 <= i < 20 }"); in construct_schedule_tree()
246 auto node = isl::schedule_node::from_domain(A.unite(B)); in construct_schedule_tree()
249 isl::union_set_list filters(ctx, 0); in construct_schedule_tree()
253 isl::multi_union_pw_aff f_A(ctx, "[ { A[i] -> [i] } ]"); in construct_schedule_tree()
257 auto band = node.as<isl::schedule_node_band>(); in construct_schedule_tree()
261 isl::multi_union_pw_aff f_B(ctx, "[ { B[i] -> [i] } ]"); in construct_schedule_tree()
278 static isl::schedule_node test_schedule_tree_generic(isl::ctx ctx) in test_schedule_tree_generic()
283 assert(IS_TRUE(root.isa<isl::schedule_node_domain>())); in test_schedule_tree_generic()
284 root = root.as<isl::schedule_node_domain>().child(0).parent(); in test_schedule_tree_generic()
287 auto inc_count = [&count](isl::schedule_node node) { in test_schedule_tree_generic()
303 static void test_ast_build_unroll(isl::schedule schedule) in test_ast_build_unroll()
306 auto mark_unroll = [](isl::schedule_node node) { in test_ast_build_unroll()
307 if (IS_TRUE(node.isa<isl::schedule_node_band>())) { in test_ast_build_unroll()
308 auto band = node.as<isl::schedule_node_band>(); in test_ast_build_unroll()
318 [&count_ast](isl::ast_node node, isl::ast_build build) { in test_ast_build_unroll()
322 auto build = isl::ast_build(schedule.ctx()); in test_ast_build_unroll()
336 static isl::schedule test_ast_build_generic(isl::ctx ctx) in test_ast_build_generic()
342 [&count_ast](isl::ast_node node, isl::ast_build build) { in test_ast_build_generic()
346 auto build = isl::ast_build(ctx); in test_ast_build_generic()
365 static void test_ast_build_expr(isl::ctx ctx) in test_ast_build_expr()
367 isl::pw_aff pa(ctx, "[n] -> { [n + 1] }"); in test_ast_build_expr()
368 isl::ast_build build = isl::ast_build::from_context(pa.domain()); in test_ast_build_expr()
371 auto op = expr.as<isl::ast_expr_op>(); in test_ast_build_expr()
372 assert(IS_TRUE(op.isa<isl::ast_expr_op_add>())); in test_ast_build_expr()