-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[mlir][acc] Use consistent name for device_num operand #136745
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
Conversation
`acc.set`, `acc.init`, and `acc.shutdown` take a `device_num` operand. However, this was named inconsistently. Give it the same consistent name for all aforementioned operations.
|
@llvm/pr-subscribers-clangir @llvm/pr-subscribers-mlir-openacc Author: Razvan Lupusoru (razvanlupusoru) Changes
Full diff: https://github.com/llvm/llvm-project/pull/136745.diff 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
index 275472bc5edd9..5e249e639d837 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
@@ -2611,11 +2611,11 @@ def OpenACC_InitOp : OpenACC_Op<"init", [AttrSizedOperandSegments]> {
}];
let arguments = (ins OptionalAttr<TypedArrayAttrBase<OpenACC_DeviceTypeAttr, "Device type attributes">>:$device_types,
- Optional<IntOrIndex>:$deviceNumOperand,
+ Optional<IntOrIndex>:$deviceNum,
Optional<I1>:$ifCond);
let assemblyFormat = [{
- oilist(`device_num` `(` $deviceNumOperand `:` type($deviceNumOperand) `)`
+ oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`
| `if` `(` $ifCond `)`
) attr-dict-with-keyword
}];
@@ -2642,11 +2642,11 @@ def OpenACC_ShutdownOp : OpenACC_Op<"shutdown", [AttrSizedOperandSegments]> {
}];
let arguments = (ins OptionalAttr<TypedArrayAttrBase<OpenACC_DeviceTypeAttr, "Device type attributes">>:$device_types,
- Optional<IntOrIndex>:$deviceNumOperand,
+ Optional<IntOrIndex>:$deviceNum,
Optional<I1>:$ifCond);
let assemblyFormat = [{
- oilist(`device_num` `(` $deviceNumOperand `:` type($deviceNumOperand) `)`
+ oilist(`device_num` `(` $deviceNum `:` type($deviceNum) `)`
|`if` `(` $ifCond `)`
) attr-dict-with-keyword
}];
|
clementval
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.
LGTM. Thanks Razvan!
erichkeane
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.
Thanks! This might end up failing to compile the clang-lowering as a result, so I'll see if I can just pop a patch onto this to make it 'just work' for us.
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.
Also, we have getIfCondMutable in a number of places as well, which is now inconsistent with skipping the 'operand'.
I am not sure I follow - are you saying that for consistency, you think that the word 'operand' should be included in the name of |
|
I plan on merging this as soon as the 2 pending checks complete :) |
I guess I would like us to be consistent between all of them? I consider I admit it is quite subjective, and I'm happy as long as the name of the 'same thing' is the same between constructs, but I would expect them to either consistently name that it is the argument to the clause, or the clause itself. |
Despite the above suggestion, I still believe this is a positive change, so still support merging this. |
`acc.set`, `acc.init`, and `acc.shutdown` take a `device_num` operand. However, this was named inconsistently. Give it the same consistent name for all aforementioned operations. --------- Co-authored-by: erichkeane <[email protected]>
acc.set,acc.init, andacc.shutdowntake adevice_numoperand. However, this was named inconsistently. Give it the same consistent name for all aforementioned operations.