[mlir][sparse][nfc] Use tensor.generate in sparse integration tests
authorRajas Vanjape <vmrajas@google.com>
Mon, 8 Aug 2022 15:23:36 +0000 (15:23 +0000)
committerRajas Vanjape <vmrajas@google.com>
Mon, 8 Aug 2022 16:44:45 +0000 (16:44 +0000)
commit333f98b4b68872fd7436d987f2e3dfb4f3e9efba
tree09ec9a139021a642c98ef075afba2faf22c214e1
parentc1f65df19c0f7324db8a7ec235308aee55fe22ef
[mlir][sparse][nfc] Use tensor.generate in sparse integration tests

Currently, dense tensors are initialized in Sparse Integration tests using
"buffer.tensor_alloc and scf.for" . This makes code harder to read and maintain.
This diff uses tensor.generate instead to initialize dense tensors.

Testing: Ran integration tests after building with -DLLVM_USE_SANITIZER=Address flag.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D131404
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir