Files
clang-p2996/mlir/test/python/dialects/sparse_tensor/passes.py
Aart Bik 58d12332a4 [mlir][sparse][capi][python] add sparse tensor passes
First set of "boilerplate" to get sparse tensor
passes available through CAPI and Python.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D102362
2021-05-12 16:40:50 -07:00

23 lines
430 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('sparsification')
PassManager.parse('sparse-tensor-conversion')
# CHECK: SUCCESS
print('SUCCESS')