[Mlir-commits] [mlir] [mlir][spirv] Simplify gpu reduction to spirv logic. NFC. (PR #73546)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 27 09:08:08 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff b9b627fbc3bc64cd3e7e009917df35d2971827d9 b83ea3bc0d8901e4dc473e47c5524e29f4a186c1 -- mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index 655cd1f7a2..5a88ab3518 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -485,9 +485,7 @@ static std::optional<Value> createGroupReduceOp(OpBuilder &builder,
Location loc, Value arg,
gpu::AllReduceOperation opType,
bool isGroup, bool isUniform) {
- enum class ElemType {
- Float, Boolean, Integer
- };
+ enum class ElemType { Float, Boolean, Integer };
using FuncT = Value (*)(OpBuilder &, Location, Value, bool, bool);
struct OpHandler {
gpu::AllReduceOperation kind;
@@ -500,7 +498,8 @@ static std::optional<Value> createGroupReduceOp(OpBuilder &builder,
if (isa<FloatType>(type)) {
elementType = ElemType::Float;
} else if (auto intTy = dyn_cast<IntegerType>(type)) {
- elementType = (intTy.getIntOrFloatBitWidth() == 1) ? ElemType::Boolean : ElemType::Integer;
+ elementType = (intTy.getIntOrFloatBitWidth() == 1) ? ElemType::Boolean
+ : ElemType::Integer;
} else {
return std::nullopt;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/73546
More information about the Mlir-commits
mailing list