From 236609cdfdd2ae8940fc1ede1e739e824f7e3bb8 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Tue, 7 Sep 2021 12:57:47 -0500 Subject: [PATCH] [Hexagon] Fix VTCM allocation Check if a buffer is in the `vtcm_buffers` list, before it's removed from it. --- python/tvm/contrib/hexagon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/tvm/contrib/hexagon.py b/python/tvm/contrib/hexagon.py index 6364ef749dd9..fe256163f73c 100644 --- a/python/tvm/contrib/hexagon.py +++ b/python/tvm/contrib/hexagon.py @@ -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")