18#include <isl/typed_cpp.h>
20static void die_impl(
const char *file,
int line,
const char *message)
22 fprintf(stderr,
"Assertion failed in %s:%d %s\n", file, line, message);
32 return die_impl(file, line, message);
35#define die(msg) die_impl(__FILE__, __LINE__, msg)
37#define assert(exp) assert_impl(exp, __FILE__, __LINE__, #exp)
57 die(
"no exception raised");
58 }
catch (
const isl::exception_invalid &e) {
89 isl::set s(ctx,
"{ [0]; [1]; [2] }");
91 std::vector<isl::basic_set> basic_sets;
94 basic_sets.push_back(bs);
99 assert(basic_sets.size() == 3);
112 die(
"no exception raised");
113 }
catch (
char const *s) {
129 std::map<std::string, isl::map> data = {
130 {
"a",
isl::map(ctx,
"{ [0] -> [1] }") },
131 {
"b",
isl::map(ctx,
"{ [1] -> [0] }") },
132 {
"c",
isl::map(ctx,
"{ [i = 0:1] -> [i] }") },
135 for (
const auto &kvp: data)
136 list = list.
add(kvp.first);
137 id = data.
at(
"a").space().domain().identity_multi_pw_aff_on_domain();
139 auto map = data.at(
b.name()).apply_domain(data.at(
a.name()));
140 return !
map.lex_ge_at(
id).is_empty();
143 sorted = sorted.
concat(scc);
162 auto fail = [] (
isl::set s) ->
bool {
168 die(
"no exception raised");
169 }
catch (
char const *s) {
185 static_assert(std::is_nothrow_copy_constructible<isl::exception>::value,
186 "exceptions must be nothrow-copy-constructible");
187 static_assert(std::is_nothrow_assignable<isl::exception,
188 isl::exception>::value,
189 "exceptions must be nothrow-assignable");
193 }
catch (
const isl::exception_unsupported &error) {
194 die(
"caught wrong exception");
195 }
catch (
const isl::exception &error) {
196 assert(strstr(error.what(),
"without explicit domain"));
199 assert(strstr(copy.what(),
"without explicit domain"));
220 root.map_descendant_bottom_up(fail_map);
221 die(
"no exception raised");
222 }
catch (
char const *s) {
232 root.foreach_descendant_top_down(
inc_count);
240 root.foreach_descendant_top_down(inc_count_once);
246 assert(root.child(0).every_descendant(is_not_domain));
247 assert(!root.every_descendant(is_not_domain));
255 root.every_descendant(fail);
256 die(
"no exception raised");
257 }
catch (
char const *s) {
267 filters = filters.unite(filter.filter());
286 int count_ast_fail = 0;
287 auto fail_inc_count_ast =
296 build = build.set_at_each_domain(fail_inc_count_ast);
299 auto ast = build.node_from(
schedule);
300 }
catch (
char const *s) {
304 assert(count_ast_fail > 0);
305 auto build_copy = build;
312 build_copy = build_copy.set_at_each_domain(inc_count_ast);
313 auto ast = build_copy.node_from(
schedule);
318 assert(count_ast_fail == 2);
332 isl::typed::map<ST, AR> access(ctx,
"{ S[i, j] -> A[i] }");
333 isl::typed::set<ST> instances(ctx,
"{ S[i, j] : 0 <= i, j < 10 }");
336 access.intersect_domain(instances);
338 access.intersect_range(instances);
isl::id_list concat(isl::id_list list2) const
isl::id at(int index) const
isl::id_list add(isl::id el) const
boolean every_descendant(const std::function< boolean(isl::schedule_node)> &test) const
stat foreach_basic_set(const std::function< stat(isl::basic_set)> &fn) const
static isl::union_map from(isl::multi_union_pw_aff mupa)
boolean every_set(const std::function< boolean(isl::set)> &test) const
isl_ctx * isl_ctx_alloc(void)
void isl_ctx_free(isl_ctx *ctx)
static int count(int *con, unsigned len, int status)
static bool is_equal(const T &a, const T &b)
static void test_space(isl::ctx ctx)
void test_return_string(isl::ctx ctx)
void test_return_int(isl::ctx ctx)
static void test_ast_build_expr(isl::ctx ctx)
static void test_every_generic(isl::ctx ctx)
static isl::schedule test_ast_build_generic(isl::ctx ctx)
static isl::schedule_node test_schedule_tree_generic(isl::ctx ctx)
void test_parameters(isl::ctx ctx)
void test_return_obj(isl::ctx ctx)
void test_pointer(isl::ctx ctx)
void test_constructors(isl::ctx ctx)
static void test_ast_build(isl::ctx ctx)
static void die_impl(const char *file, int line, const char *message)
static void assert_impl(bool condition, const char *file, int line, const char *message)
static void test_every(isl::ctx ctx)
static void test_foreach(isl::ctx ctx)
static void test_foreach_scc(isl::ctx ctx)
static void test_schedule_tree(isl::ctx ctx)
static void test_exception(isl::ctx ctx)
static void test_return(isl::ctx ctx)
static void test_typed(isl::ctx ctx)
static void test_return_bool(isl::ctx ctx)
static isl_stat inc_count(__isl_take isl_map *map, void *user)
isl_stat isl_options_set_on_error(isl_ctx *ctx, int val)
#define ISL_ON_ERROR_ABORT