Skip to content

Commit fc73736

Browse files
committed
[mlir] Fix -Wunused-variable in MeshOps.cpp (NFC)
/llvm-project/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp:182:16: error: unused variable 'inAxis' [-Werror,-Wunused-variable] auto inAxis = dimSz % inShape.size(); ^
1 parent 53609b9 commit fc73736

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/Dialect/Mesh/IR/MeshOps.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ static void shardShape(const InShape &inShape, const MeshShape &meshShape,
178178
if (!shardedDimsSizes.empty()) {
179179
for (auto [tensorAxis, innerSplitAxes] : llvm::enumerate(splitAxes)) {
180180
if (innerSplitAxes.empty()) {
181+
#ifndef NDEBUG
181182
for (auto dimSz : shardedDimsSizes) {
182183
auto inAxis = dimSz % inShape.size();
183184
assert(inShape[inAxis] == dimSz || dimSz == ShapedType::kDynamic ||
184185
inShape[inAxis] == ShapedType::kDynamic);
185186
}
187+
#endif // NDEBUG
186188
} else {
187189
// find sharded dims in sharded_dims_sizes with same static size on
188190
// all devices. Use kDynamic for dimensions with dynamic or non-uniform

0 commit comments

Comments
 (0)