fix for code warnings at compiation time#236
fix for code warnings at compiation time#236vyast-softserveinc wants to merge 1 commit intodevelfrom
Conversation
pavlo-hilei
left a comment
There was a problem hiding this comment.
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.
Is that a correct behavior that LessEqual translates to LessThan?
There was a problem hiding this comment.
Is that okay that we skip other BinOp cases?
There was a problem hiding this comment.
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.
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.
But we still don't handle UnOp::Other case, which will leave firstMeta.inc.op.bo uninitialized
There was a problem hiding this comment.
I would ask the author of this code what should happen
There was a problem hiding this comment.
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 |
| case BinOp::Ge: | ||
| secondMeta.condition.op = BinOp::Gt; | ||
| break; | ||
| if (secondMeta.condition.op == BinOp::Le) { |
There was a problem hiding this comment.
Is that a correct behavior that LessEqual translates to LessThan?
Yes. That's correct.
No description provided.