From 217b0fa4b084e49a82944d2ec9f0a9ccf3bdeb2f Mon Sep 17 00:00:00 2001 From: David Monahan Date: Tue, 24 Aug 2021 11:49:49 +0100 Subject: IVGCVSW-6216 PCA: Documentation Updates * Added the UseCustomMemoryAllocator interface to the Backend Developer Guide * Added the GetCapabilities interface to the Backend Developer Guide Signed-off-by: David Monahan Change-Id: I26e96ec1b3fe74b52c770269f3f79e688d196667 --- src/backends/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/backends/README.md b/src/backends/README.md index b7aa25228a..7105319f2a 100644 --- a/src/backends/README.md +++ b/src/backends/README.md @@ -226,6 +226,28 @@ runtime will hold this for its entire lifetime. It then calls the following inte * ```BeforeUnloadNetwork(NetworkId networkId)``` * ```AfterUnloadNetwork(NetworkId networkId)``` +## The UseCustomMemoryAllocator interface + +Backends can also have an associated CustomMemoryAllocator registered with them that ArmNN will use to allocate +intra/inter-layer memory. This particular feature is required if you want a backend to use ProtectedContentAllocation. +To support this on your own backend you must implement the UseCustomMemoryAllocator interface. + +This interface returns a boolean value which indicates if the provided allocator is supported by +the backend. This interface is also used by the lambda function returned by the Backend Registry to configure +the CustomMemoryAllocator. Within the backend itself there should be a wrapper class to convert the generic +CustomMemoryAllocator provided by the interface into something that is more suitable for your own backend. + +Examples of how this can be done are in the [ClBackend header](cl/ClBackend.hpp) and the +[ClRegistryInitializer header](cl/ClRegistryInitializer.cpp) + +## The GetCapabilities interface + +This is a list of BackendCapabilities currently supported by the backend. It consists of a constant list of +Name/Value pairs, each containing a string name, and a boolean value to indicate support. For example to +indicate support for ProtectedContentAllocation you would return {"ProtectedContentAllocation", true} + +An example can be found at the top of [ClBackend header](cl/ClBackend.hpp) + ## Dynamic backends Backends can also be loaded by Arm NN dynamically at runtime. -- cgit v1.2.1