Skip to content

Commit 40c8c44

Browse files
authored
fix llvm tests (#149)
1 parent 061aa1d commit 40c8c44

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

tests/test_llvm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
# noinspection PyUnresolvedReferences
1010
from mlir.extras.testing import MLIRContext, filecheck, mlir_ctx as ctx
11-
from util import llvm_bindings_not_installed
11+
from util import llvm_bindings_not_installed, llvm_amdgcn_bindings_not_installed
1212

1313
# needed since the fix isn't defined here nor conftest.py
1414
pytest.mark.usefixtures("ctx")
1515

1616

17-
@pytest.mark.skipif(llvm_bindings_not_installed(), reason="llvm bindings not installed")
17+
@pytest.mark.skipif(
18+
llvm_bindings_not_installed() or llvm_amdgcn_bindings_not_installed(),
19+
reason="llvm bindings not installed or llvm_amdgcn bindings not installed",
20+
)
1821
def test_call_instrinsic(ctx: MLIRContext):
1922
@func(emit=True)
2023
def sum(a: T.i32(), b: T.i32(), c: T.f32()):

tests/util.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ def llvm_bindings_not_installed():
3838
return True
3939

4040

41+
def llvm_amdgcn_bindings_not_installed():
42+
try:
43+
from mlir.extras.dialects.ext.llvm import amdgcn
44+
45+
# don't skip
46+
return False
47+
48+
except ImportError:
49+
# skip
50+
return True
51+
52+
4153
def hip_check(call_result):
4254
from hip import hip
4355

0 commit comments

Comments
 (0)