Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/SparseTensor/codegen_sparse_dealloc.mlir
- This file was added.
// RUN: mlir-opt %s --post-sparsification-rewrite="enable-runtime-library=false" \ | |||||
// RUN: --sparse-tensor-codegen=create-sparse-deallocs=false \ | |||||
// RUN: --canonicalize --cse | FileCheck %s -check-prefix=CHECK-NO-DEALLOC | |||||
// RUN: mlir-opt %s --post-sparsification-rewrite="enable-runtime-library=false" \ | |||||
// RUN: --sparse-tensor-codegen=create-sparse-deallocs=true \ | |||||
// RUN: --canonicalize --cse | FileCheck %s -check-prefix=CHECK-DEALLOC | |||||
#CSR = #sparse_tensor.encoding<{ dimLevelType = ["dense", "compressed"]}> | |||||
#CSC = #sparse_tensor.encoding<{ | |||||
dimLevelType = ["dense", "compressed"], | |||||
dimOrdering = affine_map<(i,j) -> (j,i)> | |||||
}> | |||||
// | |||||
// No memref.dealloc is user-requested so | |||||
// CHECK-NO-DEALLOC-LABEL: @sparse_convert_permuted | |||||
aartbik: user-requested | |||||
// CHECK-NO-DEALLOC-NOT: memref.dealloc | |||||
Not Done ReplyInline Actionscan you add a CHECK-NO-DEALLOC-LABEL: @sparse_convert_permuted and CHECK-DEALLOC-LABEL: @sparse_convert_permuted It clearly works without, but it feels a bit cleaner to avoid matching output elsewhere if this every changes aartbik: can you add a
CHECK-NO-DEALLOC-LABEL: @sparse_convert_permuted
and
CHECK-DEALLOC-LABEL… | |||||
// | |||||
// Otherwise memref.dealloc is created to free temporary sparse buffers. | |||||
// CHECK-DEALLOC-LABEL: @sparse_convert_permuted | |||||
// CHECK-DEALLOC: memref.dealloc | |||||
// | |||||
func.func @sparse_convert_permuted(%arg0: tensor<?x?xf32, #CSR>) -> tensor<?x?xf32, #CSC> { | |||||
%0 = sparse_tensor.convert %arg0 : tensor<?x?xf32, #CSR> to tensor<?x?xf32, #CSC> | |||||
return %0 : tensor<?x?xf32, #CSC> | |||||
} |
user-requested