-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[mlir][spirv] Add instruction OpGroupNonUniformRotateKHR #133428
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
Changes from 3 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -304,6 +304,36 @@ LogicalResult GroupNonUniformLogicalXorOp::verify() { | |||||
| return verifyGroupNonUniformArithmeticOp<GroupNonUniformLogicalXorOp>(*this); | ||||||
| } | ||||||
|
|
||||||
| //===----------------------------------------------------------------------===// | ||||||
| // spirv.GroupNonUniformRotateKHR | ||||||
| //===----------------------------------------------------------------------===// | ||||||
|
|
||||||
| LogicalResult GroupNonUniformRotateKHROp::verify() { | ||||||
| spirv::Scope scope = getExecutionScope(); | ||||||
| if (scope != spirv::Scope::Workgroup && scope != spirv::Scope::Subgroup) | ||||||
| return emitOpError("execution scope must be 'Workgroup' or 'Subgroup'"); | ||||||
|
|
||||||
| if (getDelta().getType().isSignedInteger()) | ||||||
|
||||||
| // SPIR-V type definitions |
But I'm not going to lie, I sometimes personally get quite confused looking for the correct type :)
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.
Outdated
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.
Use the full type here since the type is not obvious based on the RHS.
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.
Outdated
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.
Since it's only used inside this if, you can do:
| if (clusterSizeVal) { | |
| if (TheType clusterSizeVal = getClusterSize()) { |
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.
Outdated
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.
Same as above.
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.
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.
Should we spell the type of the
$valuehere to beAnyTypeOf<[SPIRV_ScalarOrVectorOf<SPIRV_Float>, SPIRV_ScalarOrVectorOf<SPIRV_Integer>, SPIRV_ScalarOrVectorOf<SPIRV_Bool>]>, which is the same type as a result?I know the spec says nothing about the type directly and only defines it in terms of the result:
But I had this discussion with @kuhar in the past: #124571 (comment) and it seems that we agreed that being more specific is better.
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.