From dc18ceaa54957d5ac05292b363a5ac6fe479f409 Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Fri, 16 Feb 2024 11:04:46 +0100 Subject: Add NPU device type to capabilities In preparation to support the Linux kernel driver directly managing the NPU without a subsystem. A NPU device type has been added to the capabilities to be able to specify what kind of NPU is used. Change-Id: I45345b7d75d234f821d70b858453d3af2a99194e Signed-off-by: Mikael Olsson --- driver_library/python/src/ethosu_driver/swig/driver.i | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'driver_library/python/src/ethosu_driver/swig/driver.i') diff --git a/driver_library/python/src/ethosu_driver/swig/driver.i b/driver_library/python/src/ethosu_driver/swig/driver.i index a8db7c1..721e4d0 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-2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: Copyright 2020, 2022-2024 Arm Limited and/or its affiliates // SPDX-License-Identifier: Apache-2.0 // %module driver @@ -117,10 +117,21 @@ version. This also specifies is custom DMA is enabled or not. %nodefaultctor HardwareConfiguration; class HardwareConfiguration { public: - HardwareConfiguration(uint32_t macs = 0, uint32_t cmdStreamVersion = 0, bool customDma = false); + HardwareConfiguration(uint32_t macs = 0, uint32_t cmdStreamVersion = 0, uint32_t type = static_cast(DeviceType::UNKNOWN), bool customDma = false); + + %feature("docstring", + " + DeviceType enumeration + ") DeviceType; + enum class DeviceType { + UNKNOWN = 0, + SUBSYSTEM, + DIRECT, + }; uint32_t macsPerClockCycle; uint32_t cmdStreamVersion; + DeviceType type; bool customDma; }; @@ -129,6 +140,7 @@ class HardwareConfiguration { std::ostringstream out; out << "{macsPerClockCycle=" << $self->macsPerClockCycle << ", cmdStreamVersion=" << $self->cmdStreamVersion << + ", type=" << $self->type << ", customDma=" << ($self->customDma? "True": "False") << "}"; return out.str(); } -- cgit v1.2.1