xref: /llvm-project/mlir/test/python/dialects/rocdl.py (revision a7d80c50aa9121bff08d59ab4c4d7210dd2400f9)
1*a7d80c50Smax# RUN: %PYTHON %s | FileCheck %s
2*a7d80c50Smax# This is just a smoke test that the dialect is functional.
3*a7d80c50Smax
4*a7d80c50Smaxfrom mlir.ir import *
5*a7d80c50Smaxfrom mlir.dialects import rocdl
6*a7d80c50Smax
7*a7d80c50Smax
8*a7d80c50Smaxdef constructAndPrintInModule(f):
9*a7d80c50Smax    print("\nTEST:", f.__name__)
10*a7d80c50Smax    with Context(), Location.unknown():
11*a7d80c50Smax        module = Module.create()
12*a7d80c50Smax        with InsertionPoint(module.body):
13*a7d80c50Smax            f()
14*a7d80c50Smax        print(module)
15*a7d80c50Smax    return f
16*a7d80c50Smax
17*a7d80c50Smax
18*a7d80c50Smax# CHECK-LABEL: testSmoke
19*a7d80c50Smax@constructAndPrintInModule
20*a7d80c50Smaxdef testSmoke():
21*a7d80c50Smax    # CHECK: rocdl.barrier
22*a7d80c50Smax    rocdl.BarrierOp()
23