-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[REFACTOR][IR] Migrate Pass/PassContext ObjectRef to not-null #5717
Conversation
be3596a
to
6b3dd52
Compare
@@ -689,7 +689,7 @@ class CompileEngineImpl : public CompileEngineNode { | |||
cache_node->funcs = (*f)(cfunc->schedule, all_args, cache_node->func_name, key->source_func); | |||
} else { | |||
using tvm::transform::PassContext; | |||
With<PassContext> fresh_pass_ctx_scope(PassContext::Create()); | |||
With<PassContext> fresh_pass_ctx_scope(static_cast<PassContext>(PassContext())); |
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.
I don't think static cast would be necessary here, With fresh_pass_ctx_scope(PassContext()); should suffice once we defined the copy constructor
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.
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.
Would be interesting to see what error message you got. As copy constructor is clearly defined in there.
We can also use With<PassContext> fresh_pass_ctx_scope();
, which invokes the default constructor(in this case the new pass context.
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.
@tqchen : Sorry for late reply! If i dont use static_cast the testcase fails with additional assert count.
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.
@tqchen : I have changed it to default constructor now, please check. 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.
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.
@tqchen : Any thoughts on this comment?
b21369b
to
212a68c
Compare
close for now and let us revisit later. Thanks @ANSHUMAN87 |
Refer #5318
@tqchen, @jroesch : Please help review, Thanks!