-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[MLIR][docs] Mention declarePromisedInterface in Interfaces doc #88689
[MLIR][docs] Mention declarePromisedInterface in Interfaces doc #88689
Conversation
@llvm/pr-subscribers-mlir Author: Frederik Harwath (frederik-h) ChangesFull diff: https://github.com/llvm/llvm-project/pull/88689.diff 1 Files Affected:
diff --git a/mlir/docs/Interfaces.md b/mlir/docs/Interfaces.md
index 536e7613e50936..4fb6f8a88bfa8d 100644
--- a/mlir/docs/Interfaces.md
+++ b/mlir/docs/Interfaces.md
@@ -299,6 +299,19 @@ owner of the dialect containing the object nor the owner of the interface are
aware of an interface implementation, which can lead to duplicate or
diverging implementations.
+Forgetting to register an external model can lead to bugs which are hard
+to track down. The `declarePromisedInterface` function can be used
+to declare that an external model implementation for an operation
+must eventually be provided.
+```
+ void MyDialect::initialize() {
+ declarePromisedInterface<SomeInterface, SomeOp>();
+ ...
+ }
+```
+Now attempting to use the interface, e.g in a cast, without a prior
+registration of the external model will lead to a runtime error.
+
#### Dialect Fallback for OpInterface
Some dialects have an open ecosystem and don't register all of the possible
|
Would be helpful to list what the message looks like so quick googling references to this page. |
Thanks for the review. I have now added an example of the error message. |
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.
Thanks!
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.
Can you please rewrap the doc to 80 columns though?
In general I use mdformat --wrap 80
for this.
Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
* Wrap lines at 80 columns * Move a part of the remark added by the last commit out of the code block
I have only rewrapped the new changes introduced by this PR since applying it to the whole document would introduce lots of unrelated changes, i.e. the rest of the document is not formatted in that way yet. |
No description provided.