aboutsummaryrefslogtreecommitdiff
path: root/driver_library/include/ethosu.hpp
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-10-30 11:10:56 +0100
committerMikael Olsson <mikael.olsson@arm.com>2023-11-06 09:36:00 +0100
commitc081e5954cd92165b139488e76bdfef1402acee6 (patch)
tree32bc237c124e21f12287150cba040c87c8e8b7e3 /driver_library/include/ethosu.hpp
parent9c999fdd40c0bf2ae420f6f3bfe013dc6baa73c1 (diff)
downloadethos-u-linux-driver-stack-c081e5954cd92165b139488e76bdfef1402acee6.tar.gz
Change create network UAPI to take a user buffer
To not allow the buffer for a network instance to be changed after creation, the create network UAPI will now take the network model data as a user buffer. The content of the user buffer is copied into an internally allocated DMA buffer that cannot be accessed by the user. This breaks the current API so the Linux kernel NPU driver version and the driver library version have been given major version bumps. All the tests, documentation and other applications affected by the changes have been updated accordingly. Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'driver_library/include/ethosu.hpp')
-rw-r--r--driver_library/include/ethosu.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/driver_library/include/ethosu.hpp b/driver_library/include/ethosu.hpp
index 47c1868..eaa1ce7 100644
--- a/driver_library/include/ethosu.hpp
+++ b/driver_library/include/ethosu.hpp
@@ -39,12 +39,12 @@
namespace EthosU {
-constexpr uint32_t DRIVER_LIBRARY_VERSION_MAJOR = 2;
+constexpr uint32_t DRIVER_LIBRARY_VERSION_MAJOR = 3;
constexpr uint32_t DRIVER_LIBRARY_VERSION_MINOR = 0;
constexpr uint32_t DRIVER_LIBRARY_VERSION_PATCH = 0;
-constexpr uint32_t MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 2;
-constexpr uint32_t MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 2;
+constexpr uint32_t MAX_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 3;
+constexpr uint32_t MIN_SUPPORTED_KERNEL_DRIVER_MAJOR_VERSION = 3;
class Exception : public std::exception {
public:
@@ -168,12 +168,11 @@ private:
class Network {
public:
- Network(const Device &device, std::shared_ptr<Buffer> &buffer);
+ Network(const Device &device, const unsigned char *networkData, size_t networkSize);
Network(const Device &device, const unsigned index);
virtual ~Network() noexcept(false);
int ioctl(unsigned long cmd, void *data = nullptr);
- std::shared_ptr<Buffer> getBuffer();
const std::vector<size_t> &getIfmDims() const;
size_t getIfmSize() const;
const std::vector<size_t> &getOfmDims() const;
@@ -183,7 +182,6 @@ private:
void collectNetworkInfo();
int fd;
- std::shared_ptr<Buffer> buffer;
std::vector<size_t> ifmDims;
std::vector<size_t> ofmDims;
};