-
Notifications
You must be signed in to change notification settings - Fork 290
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
[HW] Add InnerSymAttr python bindings #5711
Conversation
These binding are very shallow and only support the use case of a single InnerSymProperties with a fieldID of 0. Current use cases only require this limited functionality, and in the future we will probably be changing the underlying attributes, so it doens't make sense to expose it all now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like standard Python bindings to me. Too bad we have to write this out by hand.
|
||
MlirAttribute hwInnerSymAttrGetSymName(MlirAttribute innerSymAttr) { | ||
return wrap( | ||
(Attribute)unwrap(innerSymAttr).cast<InnerSymAttr>().getSymName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the cast to (Attribute) necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly I just copied this code from elsewhere, but it appears that wrap(StringAttr)
returns an MlirIdentifier
instead of an MlirAttribute
(and it fails to compile).
DEFINE_C_API_METHODS(MlirIdentifier, mlir::StringAttr)
These binding are very shallow and only support the use case of a single InnerSymProperties with a fieldID of 0. Current use cases only require this limited functionality, and in the future we will probably be changing the underlying attributes, so it doesn't make sense to expose it all now.