aboutsummaryrefslogtreecommitdiff
path: root/driver_library/python/src/ethosu_driver/swig/driver.i
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-06-12 15:00:55 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-08-09 15:11:11 +0200
commit308e7f1352bfdab8cc90be78a82b7ce4195301bc (patch)
treee64ebb166ff2cf63f5bb9e26ecc88314f859f8de /driver_library/python/src/ethosu_driver/swig/driver.i
parentf1cfe19a5fd6ccc07e6e86cbe5ab863f4b372418 (diff)
downloadethos-u-linux-driver-stack-308e7f1352bfdab8cc90be78a82b7ce4195301bc.tar.gz
Add kernel driver version check in driver library
The driver library will now check that it's compatible with the kernel driver in use by checking the kernel driver's version. The kernel driver version has also been made available to the library users and the Python wrapper has been updated accordingly. Change-Id: Ieae8c0bfc323f945038e7264eceeab90c833f76d Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'driver_library/python/src/ethosu_driver/swig/driver.i')
-rw-r--r--driver_library/python/src/ethosu_driver/swig/driver.i15
1 files changed, 13 insertions, 2 deletions
diff --git a/driver_library/python/src/ethosu_driver/swig/driver.i b/driver_library/python/src/ethosu_driver/swig/driver.i
index 4cd8bdf..558c22e 100644
--- a/driver_library/python/src/ethosu_driver/swig/driver.i
+++ b/driver_library/python/src/ethosu_driver/swig/driver.i
@@ -1,5 +1,5 @@
//
-// SPDX-FileCopyrightText: Copyright 2020, 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
+// SPDX-FileCopyrightText: Copyright 2020, 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
// SPDX-License-Identifier: Apache-2.0
//
%module driver
@@ -29,7 +29,6 @@
%shared_ptr(EthosU::Buffer);
%shared_ptr(EthosU::Network);
-
namespace std {
%template(UintVector) vector<unsigned int>;
%template(SizeTVector) vector<size_t>;
@@ -39,6 +38,9 @@ namespace std {
namespace EthosU
{
+constexpr uint32_t MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION;
+constexpr uint32_t MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION;
+
%feature("docstring",
"
Semantic Version : major.minor.patch
@@ -166,6 +168,15 @@ public:
Capabilities: Return capabilities of device.
") capabilities;
Capabilities capabilities() const;
+
+ %feature("docstring",
+ "
+ Returns kernel driver version information.
+
+ Returns:
+ SemanticVersion: kernel driver version.
+ ") getDriverVersion;
+ const SemanticVersion &getDriverVersion() const;
};
%extend Device {