blob: 779c2135a65b4b2c2bd7f58afcb1b009cbd02563 [file] [log] [blame]
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +01001# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# Description:
17# Contains unit tests for get API version for an external consumer
Louis Verhaard11831ce2020-11-18 18:53:24 +010018from ethosu.vela.api import API_VERSION
19from ethosu.vela.api import npu_get_api_version
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +010020
21
Louis Verhaard11831ce2020-11-18 18:53:24 +010022def test_npu_get_api_version():
23 int_version = npu_get_api_version()
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +010024 version_major = int_version >> 16
25 version_minor = 0xFFFF & int_version
Louis Verhaard11831ce2020-11-18 18:53:24 +010026 assert API_VERSION == f"{version_major}.{version_minor}"