diff options
author | David Monahan <david.monahan@arm.com> | 2023-11-22 13:24:25 +0000 |
---|---|---|
committer | David Monahan <david.monahan@arm.com> | 2023-12-07 15:21:09 +0000 |
commit | 8a570466aca7ae1619fe8fa715b68419fceb142f (patch) | |
tree | 22d80676e01f4a92fc6d927b6c26d6e5939c5170 /src/backends/aclCommon/BaseMemoryManager.hpp | |
parent | 748657f2941d28bec810b7eec21e46e288002036 (diff) | |
download | armnn-8a570466aca7ae1619fe8fa715b68419fceb142f.tar.gz |
IVGCVSW-8157 - Rebase existing GpuFsa patches to 23.11
Squashed commit of the following:
IVGCVSW-7159 Add GpuFsa backend skeleton
IVGCVSW-7380 Update the GpuFsa Skeleton to build and load ACL
IVGCVSW-7381 Add IsLayerSupported implementation to GpuFsa backend
IVGCVSW-7382 Implementation of Conv2d within GpuFsa
Signed-off-by: James Conroy <james.conroy@arm.com>
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: Id23d9ee598535de7b38a99ca223cdf0ad2102cef
Diffstat (limited to 'src/backends/aclCommon/BaseMemoryManager.hpp')
-rw-r--r-- | src/backends/aclCommon/BaseMemoryManager.hpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/backends/aclCommon/BaseMemoryManager.hpp b/src/backends/aclCommon/BaseMemoryManager.hpp index af099f900a..04e0d640ab 100644 --- a/src/backends/aclCommon/BaseMemoryManager.hpp +++ b/src/backends/aclCommon/BaseMemoryManager.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017-2023 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -7,17 +7,13 @@ #include <armnn/backends/IMemoryManager.hpp> #include <armnn/backends/WorkloadFactory.hpp> -#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) -#include <arm_compute/runtime/MemoryGroup.h> -#endif - -#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) +#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) || defined(ARMCOMPUTEGPUFSA_ENABLED) #include <arm_compute/runtime/IAllocator.h> #include <arm_compute/runtime/IMemoryGroup.h> #include <arm_compute/runtime/MemoryManagerOnDemand.h> #endif -#if defined(ARMCOMPUTECL_ENABLED) +#if defined(ARMCOMPUTECL_ENABLED) || defined(ARMCOMPUTEGPUFSA_ENABLED) #include <arm_compute/runtime/CL/CLTensorAllocator.h> #endif @@ -39,7 +35,7 @@ public: void Acquire() override; void Release() override; -#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) +#if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED) || defined(ARMCOMPUTEGPUFSA_ENABLED) BaseMemoryManager(std::shared_ptr<arm_compute::IAllocator> alloc, MemoryAffinity memoryAffinity); std::shared_ptr<arm_compute::MemoryManagerOnDemand>& GetIntraLayerManager() { return m_IntraLayerMemoryMgr; } @@ -98,4 +94,24 @@ protected: }; #endif +#if defined(ARMCOMPUTEGPUFSA_ENABLED) +class GpuFsaMemoryManager : public BaseMemoryManager +{ +public: + GpuFsaMemoryManager() {} + virtual ~GpuFsaMemoryManager() {} + + GpuFsaMemoryManager(std::shared_ptr<arm_compute::IAllocator> alloc) + : BaseMemoryManager(std::move(alloc), MemoryAffinity::Buffer) + { + arm_compute::CLTensorAllocator::set_global_allocator(alloc.get()); + m_InterLayerMemoryGroup = CreateMemoryGroup(m_InterLayerMemoryMgr); + } + +protected: + std::shared_ptr<arm_compute::IMemoryGroup> + CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager) override; +}; +#endif + } //namespace armnn |