-
Notifications
You must be signed in to change notification settings - Fork 2
fix for code warnings at compiation time #236
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
base: devel
Are you sure you want to change the base?
Conversation
pavlo-hilei
left a comment
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.
This fixes warnings, but does it fix an underlying issue? Please check comments
| case BinOp::Ge: | ||
| secondMeta.condition.op = BinOp::Gt; | ||
| break; | ||
| if (secondMeta.condition.op == BinOp::Le) { |
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.
Is that a correct behavior that LessEqual translates to LessThan?
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.
Is that okay that we skip other BinOp cases?
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.
This is how it was. I would imagine that there could be any kind of Binary/Unary operation for example:
struct MyInfo { int sizes[3] };
....
@kernel void func(..., MyInfo* ptr) {
@outer for(int i =0 ; i < *ptr.sizes[0]; i += *ptr.sizes[2]) {
...
}
}
As far as I can see we just pass it as is
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.
Is that a correct behavior that LessEqual translates to LessThan?
Yes. That's correct.
| if (sz.value_or(1024) > 0) { | ||
| if (firstMeta.inc.val.empty()) { | ||
| firstMeta.inc.val = loopInfo.tileSize; | ||
| switch (firstMeta.inc.op.uo) { |
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.
But we still don't handle UnOp::Other case, which will leave firstMeta.inc.op.bo uninitialized
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 would ask the author of this code what should happen
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.
the ::Other were originally there as default values.
In case OP cannot be properly detected (or there is no increment/decrement at all), the default Other is set.
If the Other is detected at the end of loop parsing, an error must be raised.
That is how it was originally written for launcher PoC.
|
Ok in general I can rename |
kchabSS
left a comment
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.
The changes look OK.
| case BinOp::Ge: | ||
| secondMeta.condition.op = BinOp::Gt; | ||
| break; | ||
| if (secondMeta.condition.op == BinOp::Le) { |
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.
Is that a correct behavior that LessEqual translates to LessThan?
Yes. That's correct.
No description provided.