blob: b59ab65811b82e32a98ddd4c5a33cf4358e7a01a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Corstone backend module."""
from mlia.backend.config import BackendConfiguration
from mlia.backend.config import BackendType
from mlia.backend.config import System
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")
for corstone_name in CORSTONE_PRIORITY:
registry.register(
corstone_name,
BackendConfiguration(
supported_advice=[AdviceCategory.PERFORMANCE, AdviceCategory.OPTIMIZATION],
supported_systems=[System.LINUX_AMD64],
backend_type=BackendType.CUSTOM,
),
)
def is_corstone_backend(backend_name: str) -> bool:
"""Check if backend belongs to Corstone."""
return backend_name in CORSTONE_PRIORITY
|