Files
clang-p2996/mlir/test/python/dialects/sparse_tensor/passes.py
rkayaith 66645a03fc [mlir][python] Include anchor op in PassManager.parse
The pipeline string must now include the pass manager's anchor op. This
makes the parse API properly roundtrip the printed form of a pass
manager.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D136405
2022-11-03 11:49:48 -04:00

23 lines
440 B
Python

# RUN: %PYTHON %s | FileCheck %s
from mlir.ir import *
from mlir.passmanager import *
from mlir.dialects import sparse_tensor as st
def run(f):
print('\nTEST:', f.__name__)
f()
return f
# CHECK-LABEL: TEST: testSparseTensorPass
@run
def testSparseTensorPass():
with Context() as context:
PassManager.parse('any(sparsification)')
PassManager.parse('any(sparse-tensor-conversion)')
# CHECK: SUCCESS
print('SUCCESS')