aboutsummaryrefslogtreecommitdiff
path: root/src/backends/cl/ClBackend.hpp
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2021-07-14 13:50:15 +0100
committerJan Eilers <jan.eilers@arm.com>2021-07-22 11:58:01 +0100
commit15fcc7ed3163c9d4b1856955271854198c3c2696 (patch)
treea4c2991ec2150c23c593f683df749f12b425cc84 /src/backends/cl/ClBackend.hpp
parent801e2d55de7a02b98f3d77dc9775b10b2bd9f16b (diff)
downloadarmnn-15fcc7ed3163c9d4b1856955271854198c3c2696.tar.gz
IVGCVSW-6073 Add protected mode to ArmNN CreationOptions
* Adds logic to the Runtime to activate protected mode * Adds ProtectedContentAllocation backend capability to ClBackend It's not fully activated yet because the CustomAllocator is missing. Will print an error message and won't register the backend but won't fail. * Extends IBackendInternal with an UseCustomAllocator function. * Adds related unit tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I64f465c5800eb104aa90db1bbf772a4148b5072f
Diffstat (limited to 'src/backends/cl/ClBackend.hpp')
-rw-r--r--src/backends/cl/ClBackend.hpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/backends/cl/ClBackend.hpp b/src/backends/cl/ClBackend.hpp
index db03cfeff0..c742c0b204 100644
--- a/src/backends/cl/ClBackend.hpp
+++ b/src/backends/cl/ClBackend.hpp
@@ -13,13 +13,14 @@ namespace armnn
const BackendCapabilities gpuAccCapabilities("GpuAcc",
{
{"NonConstWeights", false},
- {"AsyncExecution", false}
+ {"AsyncExecution", false},
+ {"ProtectedContentAllocation", true}
});
class ClBackend : public IBackendInternal
{
public:
- ClBackend() = default;
+ ClBackend() : m_EnableCustomAllocator(false) {};
~ClBackend() = default;
static const BackendId& GetIdStatic();
@@ -70,6 +71,18 @@ public:
{
return gpuAccCapabilities;
};
+
+ virtual bool UseCustomMemoryAllocator(armnn::Optional<std::string&> errMsg) override
+ {
+ IgnoreUnused(errMsg);
+
+ // Set flag to signal the backend to use a custom memory allocator
+ m_EnableCustomAllocator = true;
+
+ return m_EnableCustomAllocator;
+ }
+
+ bool m_EnableCustomAllocator;
};
} // namespace armnn