summaryrefslogtreecommitdiff
path: root/mlir/test/python/dialects/sparse_tensor/passes.py
blob: c37c5207ebd9f8784ac8e09e736b327f5073958c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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")