Reference guide: Overview¶
General Remarks¶
Creation via Static Methods¶
To map more directly to the isl’s C interface, object creation in islpy
is done through static methods instead of through constructors. These are
marked ‘(static)’ in each class’s overview section.
Documented vs. Non-documented Functionality¶
Since islpy
is automatically generated from the isl C headers, some of
the functionality it exposes might be undocumented. Undocumented functionality
might change or vanish without notice. ‘Documented’ functionality is defined as
whatever is mentioned in the isl manual. islpy
will let you call
undocumented functions, but you are doing so at your own risk.
Invalidation of Arguments¶
You may notice that a few methods below say ‘(becomes invalid)’. This has to do with an idiosyncrasy in isl’s interface that was retained at the Python level for efficiency. Such arguments will be deleted (by isl) upon entry to the called function. If you would like to retain access to that object, simply append a .copy() to that argument. (Note that you will notice if an object got deleted for you accidentally, as the next operation on it will simply fail with an exception.)
Integers¶
Whenever an integer argument is required, islpy
supports regular Python
integers and Python long
integers. It will return Python long integers.
Automatic Casts¶
islpy
will automatically perform the following upward casts in argument
lists:
Called with |
Argument Type |
---|---|
as well as casts contained in the transitive closure of this ‘casting graph’.
Error Reporting¶
-
exception
islpy.
Error
¶
Convenience¶
-
islpy.
make_zero_and_vars
(set_vars, params=[], ctx=None)¶ - Parameters
set_vars – an iterable of variable names, or a comma-separated string
params – an iterable of variable names, or a comma-separated string
- Returns
a dictionary from variable names (in set_vars and params) to
PwAff
instances that represent each of the variables. They key ‘0’ is also include and represents aPwAff
zero constant.
New in version 2016.1.1.
This function is intended to make it relatively easy to construct sets programmatically without resorting to string manipulation.
Usage example:
v = isl.make_zero_and_vars("i,j,k", "n") myset = ( v[0].le_set(v["i"] + v["j"]) & (v["i"] + v["j"]).lt_set(v["n"]) & (v[0].le_set(v["i"])) & (v["i"].le_set(13 + v["n"])) )
-
islpy.
affs_from_space
(space)¶ - Returns
a dictionary from variable names (in set_vars and params) to
PwAff
instances that represent each of the variables in*space. They key ‘0’ is also include and represents aPwAff
zero constant.
New in version 2016.2.
This function is intended to make it relatively easy to construct sets programmatically without resorting to string manipulation.
Usage example:
s = isl.Set("[n] -> {[i,j,k]: 0<=i,j,k<n}") v = isl.affs_from_space(s.space) myset = ( v[0].le_set(v["i"] + v["j"]) & (v["i"] + v["j"]).lt_set(v["n"]) & (v[0].le_set(v["i"])) & (v["i"].le_set(13 + v["n"])) )
Lifetime Helpers¶
Global Data¶
Symbolic Constants¶
-
class
islpy.
error
¶ -
abort
= <error.abort: 1>¶
-
internal
= <error.internal: 4>¶
-
invalid
= <error.invalid: 5>¶
-
property
name
¶
-
none
= <error.none: 0>¶
-
unknown
= <error.unknown: 3>¶
-
unsupported
= <error.unsupported: 7>¶
-
property
value
¶
-
-
class
islpy.
dim_type
¶ -
all
= <dim_type.all: 5>¶
-
cst
= <dim_type.cst: 0>¶
-
div
= <dim_type.div: 4>¶
-
in_
= <dim_type.in_: 2>¶
-
property
name
¶
-
out
= <dim_type.out: 3>¶
-
param
= <dim_type.param: 1>¶
-
set
= <dim_type.out: 3>¶
-
property
value
¶
-
-
class
islpy.
fold
¶ -
list
= <fold.list: 2>¶
-
max
= <fold.max: 1>¶
-
min
= <fold.min: 0>¶
-
property
name
¶
-
property
value
¶
-
Output¶
-
class
islpy.
Printer
¶ to_str()
(static)
-
__eq__
(value, /)¶ Return self==value.
-
__hash__
()¶ Return hash(self).
-
__ne__
(value, /)¶ Return self!=value.
-
ast_op_type_set_print_name
(self, type, name)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)type –
ast_expr_op_type
name – string
- Returns
Printer
(self)
-
end_line
(self)¶
-
indent
(self, indent)¶
-
print_aff
(self, aff)¶
-
print_aff_list
(self, list)¶
-
print_ast_expr
(self, expr)¶
-
print_ast_expr_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
AstExprList
- Returns
Printer
(self)
-
print_ast_node
(self, node)¶
-
print_ast_node_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
AstNodeList
- Returns
Printer
(self)
-
print_basic_map
(self, bmap)¶
-
print_basic_map_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
BasicMapList
- Returns
Printer
(self)
-
print_basic_set
(self, bset)¶
-
print_basic_set_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
BasicSetList
- Returns
Printer
(self)
-
print_constraint
(self, c)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)c –
Constraint
- Returns
Printer
(self)
-
print_constraint_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
ConstraintList
- Returns
Printer
(self)
-
print_double
(self, d)¶
-
print_id
(self, id)¶
-
print_id_list
(self, list)¶
-
print_int
(self, i)¶
-
print_local_space
(self, ls)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)ls –
LocalSpace
- Returns
Printer
(self)
-
print_map
(self, map)¶
-
print_map_list
(self, list)¶
-
print_multi_aff
(self, maff)¶
-
print_multi_id
(self, mi)¶
-
print_multi_pw_aff
(self, mpa)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)mpa –
MultiPwAff
- Returns
Printer
(self)
-
print_multi_union_pw_aff
(self, mupa)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)mupa –
MultiUnionPwAff
- Returns
Printer
(self)
-
print_multi_val
(self, mv)¶
-
print_point
(self, pnt)¶
-
print_pw_aff
(self, pwaff)¶
-
print_pw_aff_list
(self, list)¶
-
print_pw_multi_aff
(self, pma)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)pma –
PwMultiAff
- Returns
Printer
(self)
-
print_pw_multi_aff_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
PwMultiAffList
- Returns
Printer
(self)
-
print_pw_qpolynomial
(self, pwqp)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)pwqp –
PwQPolynomial
- Returns
Printer
(self)
-
print_pw_qpolynomial_fold
(self, pwf)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)pwf –
PwQPolynomialFold
- Returns
Printer
(self)
-
print_pw_qpolynomial_fold_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
PwQPolynomialFoldList
- Returns
Printer
(self)
-
print_pw_qpolynomial_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
PwQPolynomialList
- Returns
Printer
(self)
-
print_qpolynomial
(self, qp)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)qp –
QPolynomial
- Returns
Printer
(self)
-
print_qpolynomial_fold
(self, fold)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)fold –
QPolynomialFold
- Returns
Printer
(self)
-
print_schedule
(self, schedule)¶
-
print_schedule_constraints
(self, sc)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)sc –
ScheduleConstraints
- Returns
Printer
(self)
-
print_schedule_node
(self, node)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)node –
ScheduleNode
- Returns
Printer
(self)
-
print_set
(self, map)¶
-
print_set_list
(self, list)¶
-
print_space
(self, space)¶
-
print_str
(self, s)¶
-
print_union_access_info
(self, access)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)access –
UnionAccessInfo
- Returns
Printer
(self)
-
print_union_flow
(self, flow)¶
-
print_union_map
(self, umap)¶
-
print_union_map_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
UnionMapList
- Returns
Printer
(self)
-
print_union_pw_aff
(self, upa)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)upa –
UnionPwAff
- Returns
Printer
(self)
-
print_union_pw_aff_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
UnionPwAffList
- Returns
Printer
(self)
-
print_union_pw_multi_aff
(self, upma)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)upma –
UnionPwMultiAff
- Returns
Printer
(self)
-
print_union_pw_multi_aff_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
UnionPwMultiAffList
- Returns
Printer
(self)
-
print_union_pw_qpolynomial
(self, upwqp)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)upwqp –
UnionPwQPolynomial
- Returns
Printer
(self)
-
print_union_pw_qpolynomial_fold
(self, upwf)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)upwf –
UnionPwQPolynomialFold
- Returns
Printer
(self)
-
print_union_set
(self, uset)¶
-
print_union_set_list
(self, list)¶ - Parameters
self –
Printer
(mutated in-place) (mutated in-place)list –
UnionSetList
- Returns
Printer
(self)
-
print_val
(self, v)¶
-
print_val_list
(self, list)¶
-
print_vec
(self, vec)¶
-
set_indent
(self, indent)¶
-
set_indent_prefix
(self, prefix)¶
-
set_isl_int_width
(self, width)¶
-
set_note
(self, id, note)¶
-
set_output_format
(self, output_format)¶
-
set_prefix
(self, prefix)¶
-
set_suffix
(self, suffix)¶
-
set_yaml_style
(self, yaml_style)¶
-
start_line
(self)¶
-
yaml_end_mapping
(self)¶
-
yaml_end_sequence
(self)¶
-
yaml_next
(self)¶
-
yaml_start_mapping
(self)¶
Helper functions¶
-
islpy.
align_spaces
(obj, template, obj_bigger_ok=False, across_dim_types=None)¶ Try to make the space in which obj lives the same as that of template by adding/matching named dimensions.
- Parameters
obj_bigger_ok – If True, no error is raised if the resulting obj has more dimensions than template.
-
islpy.
align_two
(obj1, obj2, across_dim_types=None)¶ Align the spaces of two objects, potentially modifying both of them.
See also
align_spaces()
.
Canonical Names for Internal Module¶
-
class
islpy._isl.
stat
¶ A status result.
-
class
islpy._isl.
error
¶ See
islpy.error
.
-
class
islpy._isl.
dim_type
¶ See
islpy.dim_type
.
-
class
islpy._isl.
fold
¶ See
islpy.fold
.
-
class
islpy._isl.
format
¶ See
islpy.format
.
-
class
islpy._isl.
yaml_style
¶ See
islpy.yaml_style
.
-
class
islpy._isl.
Printer
¶ See
islpy.Printer
.