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] Move statements from ir.h to statements.h #1898
Conversation
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.
LGTM!
So shall we separate OffloadedStmt::TaskType in a light-weighted file which doesn't need statements.h
+N on this
Codecov Report
@@ Coverage Diff @@
## master #1898 +/- ##
=======================================
Coverage 43.81% 43.81%
=======================================
Files 45 45
Lines 6174 6174
Branches 1097 1097
=======================================
Hits 2705 2705
Misses 3300 3300
Partials 169 169 Continue to review full report at Codecov.
|
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.
Awesome!!
So shall we separate OffloadedStmt::TaskType in a light-weighted file which doesn't need statements.h
+N on this
Maybe we can create an ir_fwd.h
file that contains all the existing forward declarations
Lines 20 to 34 in d266c0f
class IRBuilder; | |
class IRNode; | |
class Block; | |
class Stmt; | |
using pStmt = std::unique_ptr<Stmt>; | |
class SNode; | |
class ScratchPads; | |
using ScratchPadOptions = std::vector<std::pair<int, SNode *>>; | |
#define PER_STATEMENT(x) class x; | |
#include "taichi/inc/statements.inc.h" | |
#undef PER_STATEMENT | |
IRBuilder ¤t_ast_builder(); |
and a new OffloadedTaskType
(which used to be OffloadedStmt::TaskType
)?
SGTM! (But i'd suggest to separate |
Related issue = #933
Changes:
XxxStmt
fromir.h
tostatements.h
;ir.cpp
tofrontend_ir.cpp
;#include "statements.h"
fromvisitors.h
.Something that may be useful to reduce the compilation time of the Taichi compiler but I don't know how to do:
OffloadedStmt::TaskType
in some files (async_utils.h
for example). For now, we can only includestatements.h
, which includesir.h
.statements.h
needsir.h
because it needs the implementation ofStmt
, which also needs the implementation ofIRNode
. However,ir.h
may become too short if evenIRNode
is instatements.h
. So shall we separateOffloadedStmt::TaskType
in a light-weighted file which doesn't needstatements.h
?[Click here for the format server]