Skip to content

Commit f6212f9

Browse files
committed
Add a wrapper for Barvinok
1 parent 59db321 commit f6212f9

9 files changed

+2529
-8
lines changed

gen_wrap.py

+25-2
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,22 @@ def write_wrappers(expf, wrapf, methods):
10571057
print("SKIP (%d undocumented methods): %s" % (len(undoc), ", ".join(undoc)))
10581058

10591059

1060-
def gen_wrapper(include_dirs):
1060+
ADD_VERSIONS = {
1061+
"union_pw_aff": 15,
1062+
"multi_union_pw_aff": 15,
1063+
"basic_map_list": 15,
1064+
"map_list": 15,
1065+
"union_set_list": 15,
1066+
}
1067+
1068+
1069+
def gen_wrapper(include_dirs, include_barvinok=False, isl_version=None):
10611070
fdata = FunctionData(["."] + include_dirs)
1062-
fdata.read_header("isl_declaration_macros_expanded.h")
1071+
if isl_version is None:
1072+
fdata.read_header("isl_declaration_macros_expanded.h")
1073+
else:
1074+
fdata.read_header("isl_declaration_macros_expanded_v%d.h"
1075+
% isl_version)
10631076
fdata.read_header("isl/id.h")
10641077
fdata.read_header("isl/space.h")
10651078
fdata.read_header("isl/set.h")
@@ -1083,10 +1096,20 @@ def gen_wrapper(include_dirs):
10831096
fdata.read_header("isl/ast.h")
10841097
fdata.read_header("isl/ast_build.h")
10851098

1099+
if include_barvinok:
1100+
fdata.read_header("barvinok/isl.h")
1101+
10861102
for part, classes in PART_TO_CLASSES.items():
10871103
expf = open("src/wrapper/gen-expose-%s.inc" % part, "wt")
10881104
wrapf = open("src/wrapper/gen-wrap-%s.inc" % part, "wt")
10891105

1106+
classes = [
1107+
cls
1108+
for cls in classes
1109+
if isl_version is None
1110+
or ADD_VERSIONS.get(cls) is None
1111+
or ADD_VERSIONS.get(cls) <= isl_version]
1112+
10901113
write_wrappers(expf, wrapf, [
10911114
meth
10921115
for cls in classes

isl_declaration_macros.h

+4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ ISL_DECLARE_LIST(pw_aff)
1414
ISL_DECLARE_LIST(constraint)
1515

1616
ISL_DECLARE_LIST(basic_set)
17+
#if ISLPY_ISL_VERSION >= 15
1718
ISL_DECLARE_LIST(basic_map)
19+
#endif
1820
ISL_DECLARE_LIST(set)
21+
#if ISLPY_ISL_VERSION >= 15
1922
ISL_DECLARE_LIST(map)
2023
ISL_DECLARE_LIST(union_set)
24+
#endif
2125

2226
ISL_DECLARE_LIST(ast_expr)
2327
ISL_DECLARE_LIST(ast_node)

isl_declaration_macros_expanded.h

+4
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)