-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix merge error and compile error and bugs in buildInitValue #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,11 +149,11 @@ struct ReduceOpConversion : public OpConversionPattern<triton::ReduceOp> { | |
else if (kind == vector::CombiningKind::MAXSI) | ||
initVal = rewriter.getIntegerAttr( | ||
elemTy, | ||
static_cast<int64_t>(1UL << (elemTy.getIntOrFloatBitWidth() - 1))); | ||
static_cast<int64_t>(-(1UL << (elemTy.getIntOrFloatBitWidth() - 1)))); | ||
else if (kind == vector::CombiningKind::MINSI) | ||
initVal = rewriter.getIntegerAttr( | ||
elemTy, static_cast<int64_t>( | ||
1UL << (elemTy.getIntOrFloatBitWidth() - 1) - 1)); | ||
(1UL << (elemTy.getIntOrFloatBitWidth() - 1)) - 1)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clang compiler complains this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the fix. Do you think we also need to change |
||
else if (kind == vector::CombiningKind::MINIMUMF || | ||
kind == vector::CombiningKind::MINNUMF) { | ||
if (elemTy.isF32()) | ||
|
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 would be a sort of INT_MIN. But super interestingly, the dump of
initVal
remained the same? But what do you think? I think this explicit-
is clearer for signed int64_t?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 the point here to always have negative int64_t passed to the attribute? The dump is similar because with your change you modify only those bits that don't matter for the used type.