[Mlir-commits] [mlir] 6d5dbc7 - [mlir] Fix a warning

Kazu Hirata llvmlistbot at llvm.org
Tue Nov 15 12:21:26 PST 2022


Author: Kazu Hirata
Date: 2022-11-15T12:21:20-08:00
New Revision: 6d5dbc7d342fa0dad9f884f5918cf215ff81c33a

URL: https://github.com/llvm/llvm-project/commit/6d5dbc7d342fa0dad9f884f5918cf215ff81c33a
DIFF: https://github.com/llvm/llvm-project/commit/6d5dbc7d342fa0dad9f884f5918cf215ff81c33a.diff

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp:195:30: warning:
  cast from type ‘const long unsigned int*’ to type ‘void*’ casts away
  qualifiers [-Wcast-qual]

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp b/mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp
index 837b404f63a2..d77ec2300ecb 100644
--- a/mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp
+++ b/mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp
@@ -192,7 +192,7 @@ fromMLIRSparseTensor(const SparseTensorStorage<uint64_t, uint64_t, V> *tensor,
   const auto &cooSizes = coo->getDimSizes();
   assert(cooSizes.size() == dimRank && "Rank mismatch");
   uint64_t *shape = new uint64_t[dimRank];
-  std::memcpy((void *)shape, (void *)cooSizes.data(),
+  std::memcpy((void *)shape, (const void *)cooSizes.data(),
               sizeof(uint64_t) * dimRank);
 
   V *values = new V[nse];


        


More information about the Mlir-commits mailing list