Skip to content

Commit e0aac94

Browse files
author
Krzysztof Parzyszek
authored
[Hexagon] Fix VTCM allocation (#8954)
Check if a buffer is in the `vtcm_buffers` list, before it's removed from it.
1 parent 9a47fc0 commit e0aac94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/tvm/contrib/hexagon.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ def mutate(stmt):
194194
if isinstance(stmt, tvm.tir.Allocate):
195195
var = stmt.buffer_var
196196
scope = var.type_annotation.storage_scope
197+
is_vtcm = var in vtcm_buffers
197198
if scope == "local.vtcm":
198199
vtcm_buffers.pop()
199-
if var in vtcm_buffers:
200+
if is_vtcm:
200201
is_null = tvm.tir.call_intrin("bool", tvm.ir.Op.get("tir.isnullptr"), var)
201202
throw_error = tvm.tir.call_intrin(
202203
"int32", tvm.ir.Op.get("tir.tvm_throw_last_error")

0 commit comments

Comments
 (0)