max 2b664d678d [mlir][python bindings] turn on openmp
Just as in https://reviews.llvm.org/D157820, dialect registration is independent of any vendor specific libs having been linked/built/etc.

Reviewed By: rkayaith

Differential Revision: https://reviews.llvm.org/D158670
2023-08-23 18:17:04 -05:00

24 lines
481 B
Python

# RUN: %PYTHON %s | FileCheck %s
from mlir.ir import *
from mlir.dialects.openmp import *
def constructAndPrintInModule(f):
print("\nTEST:", f.__name__)
with Context(), Location.unknown():
module = Module.create()
with InsertionPoint(module.body):
f()
print(module)
return f
# CHECK-LABEL: test_barrier
# CHECK: module {
# CHECK: omp.barrier
# CHECK: }
@constructAndPrintInModule
def test_barrier():
barrier = BarrierOp()