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

interpreter: add type property to ShapedArray #3709

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

superlopuh
Copy link
Member

Previously not exposed.

@superlopuh superlopuh added minor For minor PRs, easy and quick to review, quickly mergeable interpreter xDSL Interpreter labels Jan 6, 2025
@superlopuh superlopuh self-assigned this Jan 6, 2025
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@242db62). Learn more about missing BASE report.
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3709   +/-   ##
=======================================
  Coverage        ?   91.33%           
=======================================
  Files           ?      467           
  Lines           ?    58548           
  Branches        ?     5647           
=======================================
  Hits            ?    53472           
  Misses          ?     3626           
  Partials        ?     1450           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -25,6 +25,10 @@ class ShapedArray(Generic[_T]):
_data: TypedPtr[_T]
shape: list[int]

@property
def type(self) -> PackableType[_T]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not get_element_type?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, that's that we use in builtin.py and the camelcase version of this is used in MLIR (e.g., TypeUtilities.cpp and friends)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the interpreter utility class, not the attribute. I guess we might want type to return some kind of ShapedType in the future, I'll rename this element_type for now.

@@ -25,6 +25,10 @@ class ShapedArray(Generic[_T]):
_data: TypedPtr[_T]
shape: list[int]

@property
def type(self) -> PackableType[_T]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, that's that we use in builtin.py and the camelcase version of this is used in MLIR (e.g., TypeUtilities.cpp and friends)

@superlopuh superlopuh merged commit 977a09e into main Jan 7, 2025
16 checks passed
@superlopuh superlopuh deleted the sasha/autotuner/shaped-array-type-property branch January 7, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter xDSL Interpreter minor For minor PRs, easy and quick to review, quickly mergeable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants