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

BasicSet

Set

BasicMap

Map

Set

UnionSet

Map

UnionMap

Space

LocalSpace

Aff

PwAff

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 a PwAff 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 a PwAff 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

class islpy.ffi_callback_handle

Some callbacks, notably those in AstBuild, need to outlive the function call to which they’re passed. These callback return a callback handle that must be kept alive until the callback is no longer needed.

Global Data

islpy.DEFAULT_CONTEXT

ISL objects being unpickled or initialized from strings will be instantiated within this Context.

New in version 2015.2.

Symbolic Constants

class islpy.error

Members:

none

abort

unknown

internal

invalid

unsupported

abort = error.abort
internal = error.internal
invalid = error.invalid
property name

(self: handle) -> str

none = error.none
unknown = error.unknown
unsupported = error.unsupported
class islpy.dim_type

Members:

cst

param

in_

out

set

div

all

all = dim_type.all
cst = dim_type.cst
div = dim_type.div
in_ = dim_type.in_
property name

(self: handle) -> str

out = dim_type.out
param = dim_type.param
set = dim_type.out
class islpy.fold

Members:

min

max

list

list = fold.list
max = fold.max
min = fold.min
property name

(self: handle) -> str

islpy.ast_op_type

alias of islpy._isl.ast_expr_op_type

class islpy.ast_expr_type

Members:

error

op

id

int

error = ast_expr_type.error
id = ast_expr_type.id
int = ast_expr_type.int
property name

(self: handle) -> str

op = ast_expr_type.op
class islpy.ast_node_type

Members:

error

for

if

block

user

block = ast_node_type.block
error = ast_node_type.error
for = ast_node_type.for
if = ast_node_type.if
property name

(self: handle) -> str

user = ast_node_type.user
class islpy.format
C = 4
EXT_POLYLIB = 6
ISL = 0
LATEX = 5
OMEGA = 3
POLYLIB = 1
POLYLIB_CONSTRAINTS = 2
class islpy.yaml_style
BLOCK = 0
FLOW = 1

Output

class islpy.Printer
ast_op_type_set_print_name(self: object, type: islpy._isl.ast_expr_op_type, name: str)object

ast_op_type_set_print_name(self, type, name)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • typeast_expr_op_type

  • name – string

Returns

Printer (self)

end_line(self: object)object

end_line(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

flush(self: object)object

flush(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

get_ctx(self: islpy._isl.Printer)object

get_ctx(self)

Parameters

selfPrinter

Returns

Context

get_note(self: islpy._isl.Printer, id: islpy._isl.Id)object

get_note(self, id)

Parameters
Returns

Id

get_output_format(self: islpy._isl.Printer)int

get_output_format(self)

Parameters

selfPrinter

Returns

int

get_str(self: islpy._isl.Printer)object

get_str(self)

Parameters

selfPrinter

Returns

string

get_yaml_style(self: islpy._isl.Printer)int

get_yaml_style(self)

Parameters

selfPrinter

Returns

int

has_note(self: islpy._isl.Printer, id: islpy._isl.Id)bool

has_note(self, id)

Parameters
Returns

bool

indent(self: object, indent: int)object

indent(self, indent)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • indentint

Returns

Printer (self)

print_aff(self: object, aff: islpy._isl.Aff)object

print_aff(self, aff)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • affAff

Returns

Printer (self)

print_aff_list(self: object, list: islpy._isl.AffList)object

print_aff_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listAffList

Returns

Printer (self)

print_ast_expr(self: object, expr: isl::ast_expr)object

print_ast_expr(self, expr)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • exprAstExpr

Returns

Printer (self)

print_ast_expr_list(self: object, list: islpy._isl.AstExprList)object

print_ast_expr_list(self, list)

Parameters
Returns

Printer (self)

print_ast_node(self: object, node: isl::ast_node)object

print_ast_node(self, node)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • nodeAstNode

Returns

Printer (self)

print_ast_node_list(self: object, list: islpy._isl.AstNodeList)object

print_ast_node_list(self, list)

Parameters
Returns

Printer (self)

print_basic_map(self: object, bmap: isl::basic_map)object

print_basic_map(self, bmap)

Parameters
Returns

Printer (self)

print_basic_map_list(self: object, list: islpy._isl.BasicMapList)object

print_basic_map_list(self, list)

Parameters
Returns

Printer (self)

print_basic_set(self: object, bset: isl::basic_set)object

print_basic_set(self, bset)

Parameters
Returns

Printer (self)

print_basic_set_list(self: object, list: islpy._isl.BasicSetList)object

print_basic_set_list(self, list)

Parameters
Returns

Printer (self)

print_constraint(self: object, c: islpy._isl.Constraint)object

print_constraint(self, c)

Parameters
Returns

Printer (self)

print_constraint_list(self: object, list: islpy._isl.ConstraintList)object

print_constraint_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listConstraintList

Returns

Printer (self)

print_double(self: object, d: float)object

print_double(self, d)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • ddouble

Returns

Printer (self)

print_id(self: object, id: islpy._isl.Id)object

print_id(self, id)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • idId

Returns

Printer (self)

print_id_list(self: object, list: islpy._isl.IdList)object

print_id_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listIdList

Returns

Printer (self)

print_int(self: object, i: int)object

print_int(self, i)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • iint

Returns

Printer (self)

print_local_space(self: object, ls: islpy._isl.LocalSpace)object

print_local_space(self, ls)

Parameters
Returns

Printer (self)

print_map(self: object, map: isl::map)object

print_map(self, map)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • mapMap

Returns

Printer (self)

print_map_list(self: object, list: islpy._isl.MapList)object

print_map_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listMapList

Returns

Printer (self)

print_multi_aff(self: object, maff: islpy._isl.MultiAff)object

print_multi_aff(self, maff)

Parameters
Returns

Printer (self)

print_multi_id(self: object, mi: islpy._isl.MultiId)object

print_multi_id(self, mi)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • miMultiId

Returns

Printer (self)

print_multi_pw_aff(self: object, mpa: islpy._isl.MultiPwAff)object

print_multi_pw_aff(self, mpa)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • mpaMultiPwAff

Returns

Printer (self)

print_multi_union_pw_aff(self: object, mupa: islpy._isl.MultiUnionPwAff)object

print_multi_union_pw_aff(self, mupa)

Parameters
Returns

Printer (self)

print_multi_val(self: object, mv: islpy._isl.MultiVal)object

print_multi_val(self, mv)

Parameters
Returns

Printer (self)

print_point(self: object, pnt: isl::point)object

print_point(self, pnt)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • pntPoint

Returns

Printer (self)

print_pw_aff(self: object, pwaff: islpy._isl.PwAff)object

print_pw_aff(self, pwaff)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • pwaffPwAff

Returns

Printer (self)

print_pw_aff_list(self: object, list: islpy._isl.PwAffList)object

print_pw_aff_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listPwAffList

Returns

Printer (self)

print_pw_multi_aff(self: object, pma: islpy._isl.PwMultiAff)object

print_pw_multi_aff(self, pma)

Parameters
Returns

Printer (self)

print_pw_multi_aff_list(self: object, list: islpy._isl.PwMultiAffList)object

print_pw_multi_aff_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listPwMultiAffList

Returns

Printer (self)

print_pw_qpolynomial(self: object, pwqp: isl::pw_qpolynomial)object

print_pw_qpolynomial(self, pwqp)

Parameters
Returns

Printer (self)

print_pw_qpolynomial_fold(self: object, pwf: isl::pw_qpolynomial_fold)object

print_pw_qpolynomial_fold(self, pwf)

Parameters
Returns

Printer (self)

print_pw_qpolynomial_fold_list(self: object, list: islpy._isl.PwQPolynomialFoldList)object

print_pw_qpolynomial_fold_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listPwQPolynomialFoldList

Returns

Printer (self)

print_pw_qpolynomial_list(self: object, list: islpy._isl.PwQPolynomialList)object

print_pw_qpolynomial_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listPwQPolynomialList

Returns

Printer (self)

print_qpolynomial(self: object, qp: isl::qpolynomial)object

print_qpolynomial(self, qp)

Parameters
Returns

Printer (self)

print_qpolynomial_fold(self: object, fold: isl::qpolynomial_fold)object

print_qpolynomial_fold(self, fold)

Parameters
Returns

Printer (self)

print_schedule(self: object, schedule: isl::schedule)object

print_schedule(self, schedule)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • scheduleSchedule

Returns

Printer (self)

print_schedule_constraints(self: object, sc: isl::schedule_constraints)object

print_schedule_constraints(self, sc)

Parameters
Returns

Printer (self)

print_schedule_node(self: object, node: isl::schedule_node)object

print_schedule_node(self, node)

Parameters
Returns

Printer (self)

print_set(self: object, map: isl::set)object

print_set(self, map)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • mapSet

Returns

Printer (self)

print_set_list(self: object, list: islpy._isl.SetList)object

print_set_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listSetList

Returns

Printer (self)

print_space(self: object, space: islpy._isl.Space)object

print_space(self, space)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • spaceSpace

Returns

Printer (self)

print_str(self: object, s: str)object

print_str(self, s)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • s – string

Returns

Printer (self)

print_union_access_info(self: object, access: isl::union_access_info)object

print_union_access_info(self, access)

Parameters
Returns

Printer (self)

print_union_flow(self: object, flow: isl::union_flow)object

print_union_flow(self, flow)

Parameters
Returns

Printer (self)

print_union_map(self: object, umap: isl::union_map)object

print_union_map(self, umap)

Parameters
Returns

Printer (self)

print_union_map_list(self: object, list: islpy._isl.UnionMapList)object

print_union_map_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listUnionMapList

Returns

Printer (self)

print_union_pw_aff(self: object, upa: islpy._isl.UnionPwAff)object

print_union_pw_aff(self, upa)

Parameters
Returns

Printer (self)

print_union_pw_aff_list(self: object, list: islpy._isl.UnionPwAffList)object

print_union_pw_aff_list(self, list)

Parameters
Returns

Printer (self)

print_union_pw_multi_aff(self: object, upma: islpy._isl.UnionPwMultiAff)object

print_union_pw_multi_aff(self, upma)

Parameters
Returns

Printer (self)

print_union_pw_multi_aff_list(self: object, list: islpy._isl.UnionPwMultiAffList)object

print_union_pw_multi_aff_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listUnionPwMultiAffList

Returns

Printer (self)

print_union_pw_qpolynomial(self: object, upwqp: isl::union_pw_qpolynomial)object

print_union_pw_qpolynomial(self, upwqp)

Parameters
Returns

Printer (self)

print_union_pw_qpolynomial_fold(self: object, upwf: isl::union_pw_qpolynomial_fold)object

print_union_pw_qpolynomial_fold(self, upwf)

Parameters
Returns

Printer (self)

print_union_set(self: object, uset: isl::union_set)object

print_union_set(self, uset)

Parameters
Returns

Printer (self)

print_union_set_list(self: object, list: islpy._isl.UnionSetList)object

print_union_set_list(self, list)

Parameters
Returns

Printer (self)

print_val(self: object, v: object)object

print_val(self, v)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • vVal

Returns

Printer (self)

print_val_list(self: object, list: islpy._isl.ValList)object

print_val_list(self, list)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • listValList

Returns

Printer (self)

print_vec(self: object, vec: islpy._isl.Vec)object

print_vec(self, vec)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • vecVec

Returns

Printer (self)

set_indent(self: object, indent: int)object

set_indent(self, indent)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • indentint

Returns

Printer (self)

set_indent_prefix(self: object, prefix: str)object

set_indent_prefix(self, prefix)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • prefix – string

Returns

Printer (self)

set_isl_int_width(self: object, width: int)object

set_isl_int_width(self, width)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • widthint

Returns

Printer (self)

set_note(self: object, id: islpy._isl.Id, note: islpy._isl.Id)object

set_note(self, id, note)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • idId

  • noteId

Returns

Printer (self)

set_output_format(self: object, output_format: int)object

set_output_format(self, output_format)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • output_formatint

Returns

Printer (self)

set_prefix(self: object, prefix: str)object

set_prefix(self, prefix)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • prefix – string

Returns

Printer (self)

set_suffix(self: object, suffix: str)object

set_suffix(self, suffix)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • suffix – string

Returns

Printer (self)

set_yaml_style(self: object, yaml_style: int)object

set_yaml_style(self, yaml_style)

Parameters
  • selfPrinter (mutated in-place) (mutated in-place)

  • yaml_styleint

Returns

Printer (self)

start_line(self: object)object

start_line(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

static to_str(ctx: islpy._isl.Context)object

to_str(ctx)

Parameters

ctxContext

Returns

Printer

yaml_end_mapping(self: object)object

yaml_end_mapping(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

yaml_end_sequence(self: object)object

yaml_end_sequence(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

yaml_next(self: object)object

yaml_next(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

yaml_start_mapping(self: object)object

yaml_start_mapping(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (self)

yaml_start_sequence(self: object)object

yaml_start_sequence(self)

Parameters

selfPrinter (mutated in-place) (mutated in-place)

Returns

Printer (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().