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

[TIR] Update LowerTVMBuiltin to use Optional<T> #14400

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

Lunderberg
Copy link
Contributor

The member variables device_type_ and device_id_ are tracked during LowerTVMBuiltin, are initially undefined, and are checked before use. This is the usage pattern expected for Optional<T>, but these variables previously had the type PrimExpr.

This commit updates these to Optional<PrimExpr>, and uses the helper function GetDeviceMethodName to add more detail to the error messages when they are undefined.

The member variables `device_type_` and `device_id_` are tracked
during `LowerTVMBuiltin`, are initially undefined, and are checked
before use.  This is the usage pattern expected for `Optional<T>`, but
these variables previously had the type `PrimExpr`.

This commit updates these to `Optional<PrimExpr>`, and uses the helper
function `GetDeviceMethodName` to add more detail to the error
messages when they are undefined.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 24, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@csullivan
Copy link
Contributor

@tvm-bot rerun

@masahi masahi merged commit cbe068c into apache:main Mar 30, 2023
@Lunderberg Lunderberg deleted the optional_primexpr_lower_tvm_builtin branch March 30, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants