diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-04-05 17:06:56 +0100 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-04-11 13:27:31 +0100 |
commit | 8d00200d5aa2011bc91ccc688ee93caf5b6980f6 (patch) | |
tree | cfd80a2cc6d6772888c8aabf93d53329e0f92b01 /src/mlia/backend/corstone | |
parent | c7c894ee0721b1076fcea25506d7b84772cc5704 (diff) | |
download | mlia-8d00200d5aa2011bc91ccc688ee93caf5b6980f6.tar.gz |
MLIA-825 Make backend installation more generic
Use the backend registry to manage installation routines for different
backends as well. This makes the process more generic and allows us
to move towards plug & play for backends (i.e. there should be no code
changes needed in the general MLIA code to add/support new backends).
Change-Id: Ib7c772ec52b2f4d857c2c9871e44dfff97e9d970
Diffstat (limited to 'src/mlia/backend/corstone')
-rw-r--r-- | src/mlia/backend/corstone/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mlia/backend/corstone/__init__.py b/src/mlia/backend/corstone/__init__.py index 5aa688b..7575ceb 100644 --- a/src/mlia/backend/corstone/__init__.py +++ b/src/mlia/backend/corstone/__init__.py @@ -4,19 +4,26 @@ from mlia.backend.config import BackendConfiguration from mlia.backend.config import BackendType from mlia.backend.config import System +from mlia.backend.corstone.install import get_corstone_300_installation +from mlia.backend.corstone.install import get_corstone_310_installation from mlia.backend.registry import registry from mlia.core.common import AdviceCategory # List of mutually exclusive Corstone backends ordered by priority -CORSTONE_PRIORITY = ("Corstone-310", "Corstone-300") +CORSTONE_PRIORITY = { + "Corstone-310": get_corstone_310_installation(), + "Corstone-300": get_corstone_300_installation(), +} -for corstone_name in CORSTONE_PRIORITY: + +for corstone_name, installation in CORSTONE_PRIORITY.items(): registry.register( corstone_name.lower(), BackendConfiguration( supported_advice=[AdviceCategory.PERFORMANCE, AdviceCategory.OPTIMIZATION], supported_systems=[System.LINUX_AMD64], backend_type=BackendType.CUSTOM, + installation=installation, ), pretty_name=corstone_name, ) |