-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] Remove FrontendContext
and the global context
#911
Conversation
So here are my thoughts (not sure it makes sense though)
WDYT? |
Can't agree more..
Ah I see. Currently I see that each
Yeah, but I'd still hope |
Right, we should not make |
Right, the problem is that many IRs are implicitly using taichi/taichi/python/export_lang.cpp Lines 256 to 258 in d19ccd9
I guess there would have to be a major refactor around how we build AST... i.e. instead of IR stmts know where to find that builder, we inverse the dependency and put the IR stmt into a builder? |
Now sure if I correctly get your point, but here is a potential solution: simply make |
Ha yeah, that is what I meant... Let me close this PR |
Since
Program
is global, and it also providescurrent_kernel
, I thinkcurrent_ast_builder()
can be implemented viacurrent_program -> current_kernel -> ir_builder
. This PR inlinesFrontendContext
' members directly intoKernel
, and removes the globalFrontendContext context
.@yuanming-hu i saw that
FrontendContext
was introduced for quite some time now (Feb 2019). Could you take a look and confirm if this change makes sense? I thinkcurrent_ast_builder()
is used when constructing the AST, during which timeprogram.current_kernel
is set:taichi/taichi/program/kernel.cpp
Lines 22 to 26 in d19ccd9
Related issue = #689
[Click here for the format server]