Skip to content

Commit

Permalink
[VTA] Move compiler related registry items to vta/build_module.py (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and trevor-m committed Jul 14, 2020
1 parent d2dfa20 commit b20f3b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 12 additions & 0 deletions vta/python/vta/build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,15 @@ def build(*args, **kwargs):
with build_config():
return tvm.build(*args, **kwargs)
return tvm.build(*args, **kwargs)


# Register key ops
tvm.ir.register_op_attr("tir.vta.coproc_sync", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.coproc_dep_push", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.coproc_dep_pop", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)

tvm.ir.register_op_attr("tir.vta.uop_push", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.uop_push", "TGlobalSymbol", "VTAUopPush")

tvm.ir.register_op_attr("tir.vta.command_handle", "TGlobalSymbol", "VTATLSCommandHandle")
tvm.ir.register_op_attr("tir.vta.command_handle", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
12 changes: 0 additions & 12 deletions vta/python/vta/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,6 @@ def coproc_dep_pop(op):
get_env().dev.command_handle,
op.args[0], op.args[1])

# register a dummy into to trigger registration of the ops
# change the info to lowering rule later.
tvm.ir.register_op_attr("tir.vta.coproc_sync", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.coproc_dep_push", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.coproc_dep_pop", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)

tvm.ir.register_op_attr("tir.vta.uop_push", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)
tvm.ir.register_op_attr("tir.vta.uop_push", "TGlobalSymbol", "VTAUopPush")

tvm.ir.register_op_attr("tir.vta.command_handle", "TGlobalSymbol", "VTATLSCommandHandle")
tvm.ir.register_op_attr("tir.vta.command_handle", "TCallEffectKind", tvm.tir.CallEffectKind.Opaque)


def _init_env():
"""Initialize the default global env"""
Expand Down

0 comments on commit b20f3b6

Please sign in to comment.