Skip to content

Commit

Permalink
[Bugfix] Fix target host for vm compiler (apache#4057)
Browse files Browse the repository at this point in the history
* fix

* tweak
  • Loading branch information
icemelon authored and wweic committed Oct 18, 2019
1 parent 7af55cf commit 96e6b3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/tvm/relay/backend/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ def compile(self, mod, target=None, target_host=None):
"""
target = _update_target(target)
target_host = None if target_host == "" else target_host
if not target_host:
for device_type, tgt in target.items():
if device_type.value == tvm.nd.cpu(0).device_type:
target_host = tgt
break
if not target_host:
target_host = "llvm" if tvm.module.enabled("llvm") else "stackvm"
target_host = tvm.target.create(target_host)
Expand Down

0 comments on commit 96e6b3f

Please sign in to comment.