-
Notifications
You must be signed in to change notification settings - Fork 974
Expand file tree
/
Copy pathtest_linux.py
More file actions
43 lines (37 loc) · 1.38 KB
/
test_linux.py
File metadata and controls
43 lines (37 loc) · 1.38 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import platform
import test_base
from examples.models import Backend, Model
if __name__ == "__main__":
# On Linux x86_64 the wheel is built with the Qualcomm backend.
# Verify that it was registered correctly.
if platform.system() == "Linux" and platform.machine() in ("x86_64", "amd64"):
from executorch.extension.pybindings.portable_lib import (
_get_registered_backend_names,
)
registered = _get_registered_backend_names()
assert (
"QnnBackend" in registered
), f"QnnBackend not found in registered backends: {registered}"
print("✓ QnnBackend is registered")
assert (
"OpenvinoBackend" in registered
), f"OpenvinoBackend not found in registered backends: {registered}"
print("✓ OpenvinoBackend is registered")
test_base.run_tests(
model_tests=[
test_base.ModelTest(
model=Model.Mv3,
backend=Backend.XnnpackQuantizationDelegation,
),
test_base.ModelTest(
model=Model.Mv3,
backend=Backend.CoreMlExportOnly,
),
]
)