CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【CINN】Add IterMark/IterSplit/IterSum structures and conversion methods #68011
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
Conversation
paddle/cinn/common/const_fold.h
Outdated
@@ -0,0 +1,75 @@ | |||
// Copyright (c) 2023 CINN Authors. All Rights Reserved. |
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.
2023 -> 2024
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.
Done
} | ||
return std::nullopt; | ||
} | ||
|
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.
会在下一个pr中引入除法,因为当前pr没有visit(Div)
paddle/cinn/common/iter_simplify.cc
Outdated
@@ -0,0 +1,275 @@ | |||
// Copyright (c) 2023 CINN Authors. All Rights Reserved. |
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.
2023 -> 2024
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.
Done
paddle/cinn/common/iter_simplify.cc
Outdated
namespace cinn { | ||
namespace common { | ||
|
||
bool isIterExpr(const Expr& a, const Expr& b) { |
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.
Done
paddle/cinn/common/iter_simplify.cc
Outdated
b.As<ir::IterSplit>() || b.As<ir::IterSum>(); | ||
} | ||
|
||
bool isOne(const Expr& expr) { |
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.
Done
Type type() const { return source.type(); } | ||
Expr source; | ||
Expr lower_factor; | ||
Expr extent; | ||
Expr scale; |
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.
Done
std::vector<Expr> args; | ||
Expr base; |
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.
Done
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.
测试文件加到test目录下
@@ -0,0 +1,219 @@ | |||
// Copyright (c) 2023 CINN Authors. All Rights Reserved. |
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.
2023 -> 2024
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.
Done
paddle/cinn/common/iter_simplify.h
Outdated
@@ -0,0 +1,78 @@ | |||
// Copyright (c) 2023 CINN Authors. All Rights Reserved. |
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.
2023 -> 2024
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.
Done
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 for const_cast
|
||
class IterMapToExprNormalizer : public ir::IRMutator<> { | ||
public: | ||
explicit IterMapToExprNormalizer(SymbolicExprAnalyzer analyzer) |
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.
explicit IterMapToExprNormalizer(SymbolicExprAnalyzer analyzer) | |
explicit IterMapToExprNormalizer(const SymbolicExprAnalyzer& analyzer) |
这里是值copy传入,然后引用这个copy?
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.
是的
PR Category
CINN
PR Types
New features
Description
Add
,Sub
,Mul
.const_fold
function into a separate file.Pcard-67164