blob: 1874423233f90ab8d3b741449ba8eba467122096 [file] [log] [blame]
Rickard Bolinbc6ee582022-11-04 08:24:29 +00001# SPDX-FileCopyrightText: Copyright 2020 Arm Limited and/or its affiliates <open-source-office@arm.com>
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +01002#
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.
Rickard Bolinbc6ee582022-11-04 08:24:29 +000016#
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +010017# Description:
18# Contains unit tests for get API version for an external consumer
Louis Verhaard11831ce2020-11-18 18:53:24 +010019from ethosu.vela.api import API_VERSION
20from ethosu.vela.api import npu_get_api_version
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +010021
22
Louis Verhaard11831ce2020-11-18 18:53:24 +010023def test_npu_get_api_version():
24 int_version = npu_get_api_version()
Patrik Gustavssonc8a22f12020-11-18 17:05:50 +010025 version_major = int_version >> 16
26 version_minor = 0xFFFF & int_version
Louis Verhaard11831ce2020-11-18 18:53:24 +010027 assert API_VERSION == f"{version_major}.{version_minor}"