diff options
Diffstat (limited to 'src/graph/Workload.cpp')
-rw-r--r-- | src/graph/Workload.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
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 |