aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/Utils.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-07-25 13:31:10 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-09-09 11:22:01 +0000
commit12833d063259cb7809a97a4262f821efdc40554f (patch)
tree455333091c9eeba97079a385e0186f56076f5169 /src/runtime/Utils.cpp
parented0e35bfe15bad01387504afc15b8553e585bdb9 (diff)
downloadComputeLibrary-12833d063259cb7809a97a4262f821efdc40554f.tar.gz
COMPMID-2204: RuntimeContext interface for NEON functions.
This patch creates the interfaces for the runtime context for NEON. Only the Neon backend implements the context which currently only holds an instance of the scheduler. The NEActivationLayer function has been updated to use the new context interface and the corresponding validation tests ported. Change-Id: I32e7e6aa888796dcbbfc5039b1e7f784a24f47da Signed-off-by: Pablo Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/1851 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'src/runtime/Utils.cpp')
-rw-r--r--src/runtime/Utils.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/runtime/Utils.cpp b/src/runtime/Utils.cpp
index 81de782399..70494be05c 100644
--- a/src/runtime/Utils.cpp
+++ b/src/runtime/Utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -23,16 +23,20 @@
*/
#include "arm_compute/runtime/Utils.h"
+#include "arm_compute/runtime/NEON/NEScheduler.h"
+
#include <map>
#include <string>
-using namespace arm_compute;
-
+namespace arm_compute
+{
+#ifndef DOXYGEN_SKIP_THIS
static const std::string information =
#include "arm_compute_version.embed"
;
+#endif /* DOXYGEN_SKIP_THIS */
-const std::string &arm_compute::string_from_scheduler_type(Scheduler::Type t)
+const std::string &string_from_scheduler_type(Scheduler::Type t)
{
static std::map<Scheduler::Type, const std::string> scheduler_type_map =
{
@@ -44,3 +48,17 @@ const std::string &arm_compute::string_from_scheduler_type(Scheduler::Type t)
return scheduler_type_map[t];
}
+
+void schedule_kernel_on_ctx(IRuntimeContext *ctx, ICPPKernel *kernel, const IScheduler::Hints &hints)
+{
+ if(ctx)
+ {
+ ARM_COMPUTE_ERROR_ON(ctx->scheduler() == nullptr);
+ ctx->scheduler()->schedule(kernel, hints);
+ }
+ else
+ {
+ NEScheduler::get().schedule(kernel, hints);
+ }
+}
+} // namespace arm_compute