Depends On D115004
Cleans up code legibility by requiring the emitCInterface parameter to be explicit at all call-sites, and defining boolean aliases for that parameter.
Paths
| Differential D115005
[mlir][sparse] Requiring emitCInterface parameter to be explicit ClosedPublic Authored by wrengr on Dec 2 2021, 4:19 PM.
Details Summary Depends On D115004 Cleans up code legibility by requiring the emitCInterface parameter to be explicit at all call-sites, and defining boolean aliases for that parameter.
Diff Detail
Event TimelineHerald added subscribers: sdasgup3, wenzhicui, Chia-hungDuan and 20 others. · View Herald Transcript This revision now requires changes to proceed.Dec 2 2021, 4:22 PM Comment Actions The default was chosen since emitCInterface is the exception when generating MLIR functions, even if the majority of our here require it. (or alternatively create a CINTERFACE_ON/CINTERFACE/OFF alias for true/false, but that may be overkill here) Comment Actions
I was thinking that might be the case, but wasn't certain. This differential just came about from golfing with the code (alongside D115004, D115008, D115010, and D115012, before I split them up into manageable chunks). So I'm not super attached to it, if you and River are opposed to the change.
So we should keep the /*emitCInterface=*/ even if there's no default? So then I'm guessing the reason for the annotation is because of the bool type rather than because of the optionality (as I'd been thinking)? Is there a style guide anywhere that covers these sorts of things? (since I don't recall seeing it in the llvm nor google guides) wrengr retitled this revision from [mlir][sparse] Changing the default for emitCInterface to [mlir][sparse] Requiring emitCInterface parameter to be explicit.Dec 3 2021, 4:09 PM Comment Actions The default was chosen since emitCInterface is the exception when generating MLIR functions, even if the majority of our here require it. (or alternatively create a CINTERFACE_ON/CINTERFACE/OFF alias for true/false, but that may be overkill here)
wrengr added inline comments.
rriddle added inline comments. This revision is now accepted and ready to land.Dec 6 2021, 2:23 PM wrengr marked 2 inline comments as done. Comment Actionschanging enum to enum class
Closed by commit rGd8731bfc93c2: [mlir][sparse] Requiring emitCInterface parameter to be explicit (authored by wrengr). · Explain WhyDec 6 2021, 8:50 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 391792 mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
|
nit: Seems safer to use a proper enum class (and more inline with coding style)