Files
clang-p2996/mlir/test/Dialect/SparseTensor/one_shot_bufferize_invalid.mlir
Yinying Li dbe1be9aa4 [mlir][sparse] Migrate tests to use new syntax (#66146)
lvlTypes = [ "compressed" ] to map = (d0) -> (d0 : compressed)
lvlTypes = [ "dense" ] to map = (d0) -> (d0 : dense)
2023-09-13 11:41:25 -04:00

13 lines
533 B
MLIR

// RUN: mlir-opt %s -one-shot-bufferize -verify-diagnostics
#SparseVector = #sparse_tensor.encoding<{
map = (d0) -> (d0 : compressed)
}>
func.func @sparse_tensor_op(%arg0: tensor<64xf32, #SparseVector>) -> tensor<64xf32, #SparseVector> {
// expected-error @below{{sparse_tensor ops must be bufferized with the sparse compiler}}
// expected-error @below{{failed to bufferize op}}
%0 = sparse_tensor.convert %arg0 : tensor<64xf32, #SparseVector> to tensor<64xf32, #SparseVector>
return %0 : tensor<64xf32, #SparseVector>
}