Skip to content

Commit

Permalink
[Hexagon] Fix VTCM allocation (apache#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 and ylc committed Jan 13, 2022
1 parent 2d758cf commit cc803b1
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 cc803b1

Please sign in to comment.