-
Notifications
You must be signed in to change notification settings - Fork 16
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
Lowering for the Matmul Intrinsic #931
Conversation
flang/lib/Lower/IntrinsicCall.cpp
Outdated
// Create mutable fir.box to be passed to the runtime for the result. | ||
// TODO: The result can also be of rank 1 if one of the input matrices | ||
// is of rank 1. Will this info be available at compile time or should | ||
// code be generated to compute the rank? |
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.
You can compute this using matrixTmpA.rank()
which will give you the argument ranks at compile time.
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.
auto args = | ||
Fortran::lower::createArguments(builder, loc, fTy, resultBox, matrixABox, | ||
matrixBBox, sourceFile, sourceLine); | ||
return builder.create<fir::CallOp>(loc, func, args).getResult(0); |
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.
Shouldn't genMatmul
return void
? Matmul
runtime functions does not return anything.
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.
Yeah. :)
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.
Initial implementation with assumption that rank will be always 2
-> Handle case where rank of one the matrices is 1. -> Add test for the above case with logical type. -> Remove return value from the matmul call.
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, thanks Kiran
ping @mleair @schweitzpgi |
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
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.
Thanks, Kiran.
No description provided.