aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/live_range.py
diff options
context:
space:
mode:
authorCharles Xu <charles.xu@arm.com>2020-05-28 07:20:52 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commit5b3dcd7323a5852bd188bb3929e7f38db3b52862 (patch)
tree4fd76343cee25274d9c61738bb4193e22613198c /ethosu/vela/live_range.py
parentb2fb212216eaa29b96ddf270a0392172265ff02c (diff)
downloadethos-u-vela-5b3dcd7323a5852bd188bb3929e7f38db3b52862.tar.gz
MLBEDSW-2269: Fix the buffer overlap issue for multi subgraphes
Signed-off-by: Charles Xu <charles.xu@arm.com> Change-Id: Ia7127148d00280bf9c3759dd6dcbe500a4cfcc78
Diffstat (limited to 'ethosu/vela/live_range.py')
-rw-r--r--ethosu/vela/live_range.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py
index 23ab67d9..2a35a119 100644
--- a/ethosu/vela/live_range.py
+++ b/ethosu/vela/live_range.py
@@ -86,12 +86,18 @@ class LiveRange:
# Set address of all unaddressed tensors in LiveRange
for tens in self.tensors:
if tens.address == 0:
- tens.address = address
- # Also need to set the address to the tensor's cpu/npu clones
- if tens.cpu_tensor is not None:
- tens.cpu_tensor.address = address
- if tens.npu_tensor is not None:
- tens.npu_tensor.address = address
+ addr = address
+ else:
+ # Limit to single tensor for the lr if the tensor address already assigned
+ assert len(self.tensors) == 1
+ addr = tens.address
+ tens.address = addr
+ # Also need to set the address to the tensor's cpu/npu clones
+ if tens.cpu_tensor is not None:
+ tens.cpu_tensor.address = addr
+ if tens.npu_tensor is not None:
+ tens.npu_tensor.address = addr
+ return addr
def get_alignment(self):
# Get max alignment of LiveRange's tensors