From 1e47888de621cbff6d6d9e3f2101094e073022b0 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Tue, 1 Mar 2022 11:21:50 -0800 Subject: [PATCH] [mlir][sparse] fix compile-time warning Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D120756 --- mlir/lib/ExecutionEngine/SparseTensorUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp index 5f093a2b8873..f468b77a606c 100644 --- a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp +++ b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp @@ -756,7 +756,7 @@ toMLIRSparseTensor(uint64_t rank, uint64_t nse, uint64_t *shape, V *values, // Verify that perm is a permutation of 0..(rank-1). std::vector order(perm, perm + rank); std::sort(order.begin(), order.end()); - for (int i = 0; i < rank; ++i) { + for (uint64_t i = 0; i < rank; ++i) { if (i != order[i]) { fprintf(stderr, "Permutation is not a permutation of 0..%lu\n", rank); exit(1); @@ -764,7 +764,7 @@ toMLIRSparseTensor(uint64_t rank, uint64_t nse, uint64_t *shape, V *values, } // Verify that the sparsity values are supported. - for (int i = 0; i < rank; ++i) { + for (uint64_t i = 0; i < rank; ++i) { if (sparsity[i] != DimLevelType::kDense && sparsity[i] != DimLevelType::kCompressed) { fprintf(stderr, "Unsupported sparsity value %d\n",