Skip to content

Commit

Permalink
[Hexagon] Fix VTCM allocation (#8954)
Browse files Browse the repository at this point in the history
Check if a buffer is in the `vtcm_buffers` list, before it's removed
from it.
  • Loading branch information
Krzysztof Parzyszek authored Sep 8, 2021
1 parent 9a47fc0 commit e0aac94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/tvm/contrib/hexagon.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ def mutate(stmt):
if isinstance(stmt, tvm.tir.Allocate):
var = stmt.buffer_var
scope = var.type_annotation.storage_scope
is_vtcm = var in vtcm_buffers
if scope == "local.vtcm":
vtcm_buffers.pop()
if var in vtcm_buffers:
if is_vtcm:
is_null = tvm.tir.call_intrin("bool", tvm.ir.Op.get("tir.isnullptr"), var)
throw_error = tvm.tir.call_intrin(
"int32", tvm.ir.Op.get("tir.tvm_throw_last_error")
Expand Down

0 comments on commit e0aac94

Please sign in to comment.