From 52ecb06b5627902a2f4514fba977e98454af4872 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 25 May 2018 13:32:10 +0100 Subject: COMPMID-1180: Add support for bucket multi-threading (Part 1) - Add an entry point to allow the user to parallelise an arbitrary queue of workloads (Will be used to interleave GEMM / BufferManager) - Added a ThreadFeeder which acts as a thread-safe work distributor Change-Id: I3a84fb7446c453cfcd337e21338c2ccf9f29f7b3 Note: This patch doesn't introduce any change in the default strategy, therefore it shouldn't have any impact on the performance Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/133058 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- arm_compute/runtime/IScheduler.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arm_compute/runtime/IScheduler.h') diff --git a/arm_compute/runtime/IScheduler.h b/arm_compute/runtime/IScheduler.h index a0bcada722..76ff5a3de0 100644 --- a/arm_compute/runtime/IScheduler.h +++ b/arm_compute/runtime/IScheduler.h @@ -26,6 +26,8 @@ #include "arm_compute/core/CPP/CPPTypes.h" +#include + namespace arm_compute { class ICPPKernel; @@ -34,6 +36,8 @@ class ICPPKernel; class IScheduler { public: + /** Signature for the workloads to execute */ + using Workload = std::function; /** Default constructor. */ IScheduler(); @@ -59,6 +63,14 @@ public: */ virtual void schedule(ICPPKernel *kernel, unsigned int split_dimension) = 0; + /** Execute all the passed workloads + * + * @note there is no guarantee regarding the order in which the workloads will be executed or whether or not they will be executed in parallel. + * + * @param[in] workloads Array of workloads to run + */ + virtual void run_workloads(std::vector &workloads) = 0; + /** Get CPU info. * * @return CPU info. -- cgit v1.2.1