Files
rk35xx-android14/external/armnn/python/pyarmnn/test/test_supported_backends.py
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

49 lines
1.3 KiB
Python

# Copyright © 2020 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
import pytest
import pyarmnn as ann
@pytest.fixture()
def get_supported_backends_setup(shared_data_folder):
options = ann.CreationOptions()
runtime = ann.IRuntime(options)
get_device_spec = runtime.GetDeviceSpec()
supported_backends = get_device_spec.GetSupportedBackends()
yield supported_backends
def test_ownership():
options = ann.CreationOptions()
runtime = ann.IRuntime(options)
device_spec = runtime.GetDeviceSpec()
assert not device_spec.thisown
def test_to_string():
options = ann.CreationOptions()
runtime = ann.IRuntime(options)
device_spec = runtime.GetDeviceSpec()
expected_str = "IDeviceSpec {{ supportedBackends: [" \
"{}" \
"]}}".format(', '.join(map(lambda b: str(b), device_spec.GetSupportedBackends())))
assert expected_str == str(device_spec)
def test_get_supported_backends_cpu_ref(get_supported_backends_setup):
assert "CpuRef" in map(lambda b: str(b), get_supported_backends_setup)
@pytest.mark.aarch64
class TestNoneCpuRefBackends:
@pytest.mark.parametrize("backend", ["CpuAcc"])
def test_get_supported_backends_cpu_acc(self, get_supported_backends_setup, backend):
assert backend in map(lambda b: str(b), get_supported_backends_setup)