Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial cursor skeleton #193

Merged
merged 136 commits into from
May 20, 2022
Merged

Add initial cursor skeleton #193

merged 136 commits into from
May 20, 2022

Conversation

alexreinking
Copy link
Contributor

This PR lays the foundation for building a new scheduling API on top of our cursors idea. In particular, this PR includes:

  1. A new abstract Cursor type that has three concrete subtypes: a Node, a Block, and a Gap.
  2. Public navigation methods on these objects to help select parents, children, and gaps surrounding nodes and blocks.
  3. Internal functions for making unsafe AST changes that produce a forwarding function as collateral.
  4. Modifications to the pattern matching system that return cursors instead of (lists of) raw LoopIR
  5. A bugfix in the pattern matching system. Matching a single statement now always returns a block containing that single statement, rather than the statement and the remainder of the block.

Although cursors are exposed through the public API, they are currently not very useful. Only the navigation functions are public, as is the underlying proc getter. Otherwise, no other public APIs accept them.

This type will ultimately serve (at least) three purposes:

  1. It is a forwardable handle for scheduling directives, such that our vision of user-defined scheduling directives may be realized.
  2. It is an introspection tool for users to make particular scheduling decisions as in (1)
  3. It may be used internally for efficient AST modification and simplified forwarding definitions.

No progress is made on (2) in this PR.

src/exo/cursors.py Outdated Show resolved Hide resolved
src/exo/cursors.py Outdated Show resolved Hide resolved
src/exo/cursors.py Outdated Show resolved Hide resolved
src/exo/cursors.py Outdated Show resolved Hide resolved
src/exo/cursors.py Outdated Show resolved Hide resolved
src/exo/cursors.py Outdated Show resolved Hide resolved
@alexreinking alexreinking merged commit e058969 into master May 20, 2022
@alexreinking alexreinking deleted the cursors branch May 20, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Internal Implementation detail C: Scheduling The scheduling language and APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants