aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/test/test_live_range.py
diff options
context:
space:
mode:
authorJacob Bohlin <jacob.bohlin@arm.com>2020-08-28 13:25:14 +0200
committerJacob Bohlin <jacob.bohlin@arm.com>2020-09-03 10:50:10 +0200
commit0628a8c0136eebf3af8db7fd40b7aed94ff5d670 (patch)
tree65e7a49264f2df1f969122d8d7fb812773c0d4db /ethosu/vela/test/test_live_range.py
parentd2e3355813a33ccefaf112750f86c4f04d6ea12c (diff)
downloadethos-u-vela-0628a8c0136eebf3af8db7fd40b7aed94ff5d670.tar.gz
MLBEDSW-2567: CLI option to specify allocation alignment
Added the CLI option. Only applies to CPU tensors. Added an AllocationError which is raised when Allocation fails. Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com> Change-Id: I89164dea3ac7b7add7bc40aec2ce8fe50600105d
Diffstat (limited to 'ethosu/vela/test/test_live_range.py')
-rw-r--r--ethosu/vela/test/test_live_range.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ethosu/vela/test/test_live_range.py b/ethosu/vela/test/test_live_range.py
index d087dd99..2a99da54 100644
--- a/ethosu/vela/test/test_live_range.py
+++ b/ethosu/vela/test/test_live_range.py
@@ -20,6 +20,7 @@ from unittest.mock import MagicMock
import pytest
from ethosu.vela.live_range import LiveRange
+from ethosu.vela.tensor import Tensor
class TestLiveRange:
@@ -28,7 +29,7 @@ class TestLiveRange:
tens.storage_size.return_value = 4
tens.name = "test"
- live_range = LiveRange(tens=tens)
+ live_range = LiveRange(tens, Tensor.AllocationQuantum)
assert live_range.size == 4
assert live_range.name == "test"
assert live_range.tensors == [tens]
@@ -39,7 +40,7 @@ class TestLiveRange:
tens.storage_size.side_effect = [4, 3]
tens.name = "test"
- live_range = LiveRange(tens=tens)
+ live_range = LiveRange(tens, Tensor.AllocationQuantum)
live_range.add_tensor(tens)
assert live_range.size == 4
@@ -52,7 +53,7 @@ class TestLiveRange:
tens.storage_size.side_effect = [4, 5]
tens.name = "test"
- live_range = LiveRange(tens=tens)
+ live_range = LiveRange(tens, Tensor.AllocationQuantum)
# Expect an AssertionError with a message
with pytest.raises(AssertionError, match=r".* to the same LiveRange .*"):
live_range.add_tensor(tens)