Skip to content

Commit 3cc152e

Browse files
committed
fix exception when tvm not built with llvm support
1 parent 36f2502 commit 3cc152e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/tvm/tir/tensor_intrin/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@
1616
# under the License.
1717
# pylint: disable=unused-import
1818
"""Intrinsics for tensorization."""
19-
from . import arm_cpu, cuda, rocm, x86, hexagon
19+
import tvm
20+
from . import cuda
21+
22+
if hasattr(tvm.target.codegen, "llvm_version_major"):
23+
llvm_version = tvm.target.codegen.llvm_version_major(allow_none=True)
24+
if llvm_version is not None:
25+
from . import arm_cpu, x86, rocm, hexagon

0 commit comments

Comments
 (0)