Skip to content

Commit

Permalink
Add c++ style cast and remove not needed parens (#2966)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Mike Essenmacher <[email protected]>
  • Loading branch information
mikeessen authored Oct 4, 2024
1 parent 7c58751 commit 784d80c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Dialect/Mlir/VectorMachineSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ int64_t VectorMachineSupport::computeArchVectorLength(Type elementType) {
int64_t totNum = vectorizedOpNum + scalarOpNum;
if (!hasRegisterPressure) {
// Estimate default register pressure as one per 2 vector operation.
maxVectorRegisterPressure = std::max(vectorizedOpNum / 2, (int64_t)1);
maxVectorRegisterPressure =
std::max(vectorizedOpNum / 2, static_cast<int64_t>(1));
}
return totNum != 0 ? (1.0 * totProcessedValues) / (1.0 * totNum) : 1.0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/OMSort.inc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef int(
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif

#define Load(typeName, to, from) typeName (to) = (from)
#define Load(typeName, to, from) typeName to = from

// Convert f16 elements to f32 for comparison because we don't have logic to
// compare f16 elements directly on all platforms.
Expand Down

0 comments on commit 784d80c

Please sign in to comment.