diff options
author | Tim Hall <tim.hall@arm.com> | 2020-10-20 18:54:20 +0100 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-10-21 15:23:33 +0100 |
commit | 4ed38bce498e1b9a5ae917316323de444792521a (patch) | |
tree | f3721d7131eeafa14c33cf0339d579de99a3c66a /ethosu/vela/architecture_features.py | |
parent | 9358296a51b9186335304a53bd7ea5dfbe5322d8 (diff) | |
download | ethos-u-vela-4ed38bce498e1b9a5ae917316323de444792521a.tar.gz |
vela: Refactor operators to use Kernel objects
- Normalise kernel availability by requiring all operators offer a kernel
describing how much data they consume from the source, per OFM element,
regardless of whether kernels are relevant to the operation.
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: Idbcff64879fc2eccf292b6208a7d2038eb388017
Diffstat (limited to 'ethosu/vela/architecture_features.py')
-rw-r--r-- | ethosu/vela/architecture_features.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py index 04c1c62e..b77205b9 100644 --- a/ethosu/vela/architecture_features.py +++ b/ethosu/vela/architecture_features.py @@ -25,16 +25,15 @@ from .errors import OptionError from .ethos_u55_regs.ethos_u55_regs import resampling_mode from .numeric_util import round_up from .numeric_util import round_up_divide +from .operation import Kernel from .operation import NpuBlockType +from .operation import PointXYZ from .supported_operators import SupportedOperators from .tensor import MemArea from .tensor import MemType from .tensor import TensorFormat from .tensor import TensorPurpose -PointXY = namedtuple("PointXY", "x y") -PointXYZ = namedtuple("PointXYZ", "x y z") - class Block: def __init__(self, w, h, d): @@ -79,16 +78,6 @@ class Rect: return "<Rect: ({0},{1},{2}) ({3},{4},{5})>".format(self.x, self.y, self.z, self.x2, self.y2, self.z2) -class Kernel: - def __init__(self, w, h, sx=1, sy=1, dx=1, dy=1): - assert sx > 0 and sy > 0 - assert dx > 0 and dy > 0 - self.width = w - self.height = h - self.stride = PointXY(sx, sy) - self.dilation = PointXY(dx, dy) - - class SHRAMElements: IFM8 = 0 IFM16 = 1 |