From 5c2fb3f34462632b99331e2cc2d964c99fc1782b Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 1 May 2018 15:26:20 +0100 Subject: COMPMID-997: Add support for node's name in GraphAPI. Change-Id: I0ca02e42807c1ad9afeffb7202a3556feb11442f Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/129701 Tested-by: Jenkins Reviewed-by: Anthony Barbier Reviewed-by: Georgios Pinitas --- src/graph/Workload.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/graph') diff --git a/src/graph/Workload.cpp b/src/graph/Workload.cpp index f350bbf625..d8046c3511 100644 --- a/src/graph/Workload.cpp +++ b/src/graph/Workload.cpp @@ -32,9 +32,14 @@ namespace graph { void ExecutionTask::operator()() { - if(task) + TaskExecutor::get().execute_function(*this); +} + +void execute_task(ExecutionTask &task) +{ + if(task.task) { - task->run(); + task.task->run(); } } @@ -45,5 +50,16 @@ void ExecutionTask::prepare() task->prepare(); } } + +TaskExecutor::TaskExecutor() + : execute_function(execute_task) +{ +} + +TaskExecutor &TaskExecutor::get() +{ + static TaskExecutor executor; + return executor; +} } // namespace graph } // namespace arm_compute \ No newline at end of file -- cgit v1.2.1