Skip to content

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