aboutsummaryrefslogtreecommitdiff
path: root/src/graph/backends/NEON/NEDeviceBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph/backends/NEON/NEDeviceBackend.cpp')
-rw-r--r--src/graph/backends/NEON/NEDeviceBackend.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/graph/backends/NEON/NEDeviceBackend.cpp b/src/graph/backends/NEON/NEDeviceBackend.cpp
index adb87a952b..fc7b309803 100644
--- a/src/graph/backends/NEON/NEDeviceBackend.cpp
+++ b/src/graph/backends/NEON/NEDeviceBackend.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 Arm Limited.
+ * Copyright (c) 2018-2021,2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -23,18 +23,17 @@
*/
#include "arm_compute/graph/backends/NEON/NEDeviceBackend.h"
-#include "arm_compute/graph/Graph.h"
-#include "arm_compute/graph/GraphContext.h"
-#include "arm_compute/graph/INode.h"
-#include "arm_compute/graph/Logger.h"
-#include "arm_compute/graph/Tensor.h"
+#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/graph/backends/BackendRegistrar.h"
#include "arm_compute/graph/backends/NEON/NEFunctionFactory.h"
#include "arm_compute/graph/backends/NEON/NENodeValidator.h"
#include "arm_compute/graph/backends/NEON/NESubTensorHandle.h"
#include "arm_compute/graph/backends/NEON/NETensorHandle.h"
-
-#include "arm_compute/core/TensorInfo.h"
+#include "arm_compute/graph/Graph.h"
+#include "arm_compute/graph/GraphContext.h"
+#include "arm_compute/graph/INode.h"
+#include "arm_compute/graph/Logger.h"
+#include "arm_compute/graph/Tensor.h"
#include "arm_compute/runtime/Allocator.h"
#include "arm_compute/runtime/BlobLifetimeManager.h"
#include "arm_compute/runtime/IWeightsManager.h"
@@ -44,19 +43,16 @@
#include "arm_compute/runtime/PoolManager.h"
#include "arm_compute/runtime/Scheduler.h"
-#include "support/ToolchainSupport.h"
-
namespace arm_compute
{
namespace graph
{
namespace backends
{
-/** Register NEON backend */
+/** Register CPU backend */
static detail::BackendRegistrar<NEDeviceBackend> NEDeviceBackend_registrar(Target::NEON);
-NEDeviceBackend::NEDeviceBackend()
- : _allocator()
+NEDeviceBackend::NEDeviceBackend() : _allocator()
{
}
@@ -74,13 +70,13 @@ void NEDeviceBackend::release_backend_context(GraphContext &ctx)
void NEDeviceBackend::setup_backend_context(GraphContext &ctx)
{
// Set number of threads
- if(ctx.config().num_threads >= 0)
+ if (ctx.config().num_threads >= 0)
{
Scheduler::get().set_num_threads(ctx.config().num_threads);
}
// Create function level memory manager
- if(ctx.memory_management_ctx(Target::NEON) == nullptr)
+ if (ctx.memory_management_ctx(Target::NEON) == nullptr)
{
MemoryManagerContext mm_ctx;
mm_ctx.target = Target::NEON;
@@ -93,7 +89,7 @@ void NEDeviceBackend::setup_backend_context(GraphContext &ctx)
}
// Create function level weights manager
- if(ctx.weights_management_ctx(Target::NEON) == nullptr)
+ if (ctx.weights_management_ctx(Target::NEON) == nullptr)
{
WeightsManagerContext wm_ctx;
wm_ctx.target = Target::NEON;
@@ -123,22 +119,23 @@ std::unique_ptr<ITensorHandle> NEDeviceBackend::create_tensor(const Tensor &tens
TensorInfo info(tensor_desc.shape, 1, tensor_desc.data_type, tensor_desc.quant_info);
info.set_data_layout(tensor_desc.layout);
- return support::cpp14::make_unique<NETensorHandle>(info);
+ return std::make_unique<NETensorHandle>(info);
}
-std::unique_ptr<ITensorHandle> NEDeviceBackend::create_subtensor(ITensorHandle *parent, TensorShape shape, Coordinates coords, bool extend_parent)
+std::unique_ptr<ITensorHandle>
+NEDeviceBackend::create_subtensor(ITensorHandle *parent, TensorShape shape, Coordinates coords, bool extend_parent)
{
- if(parent == nullptr)
+ if (parent == nullptr)
{
return nullptr;
}
- return support::cpp14::make_unique<NESubTensorHandle>(parent, shape, coords, extend_parent);
+ return std::make_unique<NESubTensorHandle>(parent, shape, coords, extend_parent);
}
std::unique_ptr<arm_compute::IFunction> NEDeviceBackend::configure_node(INode &node, GraphContext &ctx)
{
- ARM_COMPUTE_LOG_GRAPH_VERBOSE("Configuring NEON node with ID : " << node.id() << std::endl);
+ ARM_COMPUTE_LOG_GRAPH_VERBOSE("Configuring CPU node with ID : " << node.id() << std::endl);
ARM_COMPUTE_ERROR_ON(node.assigned_target() != Target::NEON);
// Configure node
@@ -147,7 +144,7 @@ std::unique_ptr<arm_compute::IFunction> NEDeviceBackend::configure_node(INode &n
arm_compute::Status NEDeviceBackend::validate_node(INode &node)
{
- ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating NEON node with ID : " << node.id() << std::endl);
+ ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating CPU node with ID : " << node.id() << std::endl);
ARM_COMPUTE_ERROR_ON(node.assigned_target() != Target::NEON);
return NENodeValidator::validate(&node);
@@ -156,7 +153,7 @@ arm_compute::Status NEDeviceBackend::validate_node(INode &node)
std::shared_ptr<arm_compute::IMemoryManager> NEDeviceBackend::create_memory_manager(MemoryManagerAffinity affinity)
{
std::shared_ptr<ILifetimeManager> lifetime_mgr = nullptr;
- if(affinity == MemoryManagerAffinity::Buffer)
+ if (affinity == MemoryManagerAffinity::Buffer)
{
lifetime_mgr = std::make_shared<BlobLifetimeManager>();
}
@@ -175,6 +172,11 @@ std::shared_ptr<arm_compute::IWeightsManager> NEDeviceBackend::create_weights_ma
auto weights_mgr = std::make_shared<IWeightsManager>();
return weights_mgr;
}
+
+void NEDeviceBackend::sync()
+{
+ // nop
+}
} // namespace backends
} // namespace graph
} // namespace arm_compute