From c186b574e52b81c75e551cee46a6c4cc7d500c90 Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Thu, 7 Sep 2017 09:48:04 +0100 Subject: COMPMID-481: Add thread info parameter Change-Id: Iebb50a88d017445b6b37a86563ebd4abd86c5cf5 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86788 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/runtime/CPP/CPPScheduler.h | 14 -------------- arm_compute/runtime/IScheduler.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 14 deletions(-) (limited to 'arm_compute/runtime') diff --git a/arm_compute/runtime/CPP/CPPScheduler.h b/arm_compute/runtime/CPP/CPPScheduler.h index 341537a390..8351f0cbdd 100644 --- a/arm_compute/runtime/CPP/CPPScheduler.h +++ b/arm_compute/runtime/CPP/CPPScheduler.h @@ -24,7 +24,6 @@ #ifndef __ARM_COMPUTE_CPPSCHEDULER_H__ #define __ARM_COMPUTE_CPPSCHEDULER_H__ -#include "arm_compute/core/CPP/CPPTypes.h" #include "arm_compute/runtime/IScheduler.h" #include @@ -48,18 +47,6 @@ public: */ unsigned int num_threads() const override; - /** Sets the target CPU architecture. - * - * @param[in] target Target CPU. - */ - void set_target(CPUTarget target); - - /** Return the current CPU target. - * - * @return Target CPU. - */ - CPUTarget target() const; - /** Access the scheduler singleton * * @return The scheduler @@ -82,7 +69,6 @@ private: unsigned int _num_threads; std::unique_ptr _threads; - CPUTarget _target; }; } #endif /* __ARM_COMPUTE_CPPSCHEDULER_H__ */ diff --git a/arm_compute/runtime/IScheduler.h b/arm_compute/runtime/IScheduler.h index 39c027c6b7..6078abd06b 100644 --- a/arm_compute/runtime/IScheduler.h +++ b/arm_compute/runtime/IScheduler.h @@ -24,6 +24,8 @@ #ifndef __ARM_COMPUTE_ISCHEDULER_H__ #define __ARM_COMPUTE_ISCHEDULER_H__ +#include "arm_compute/core/CPP/CPPTypes.h" + namespace arm_compute { class ICPPKernel; @@ -32,6 +34,12 @@ class ICPPKernel; class IScheduler { public: + /** Default constructor. */ + IScheduler() + : _target(CPUTarget::INTRINSICS) + { + } + /** Destructor. */ virtual ~IScheduler() = default; /** Sets the number of threads the scheduler will use to run the kernels. @@ -50,6 +58,31 @@ public: * @param[in] split_dimension Dimension along which to split the kernel's execution window. */ virtual void schedule(ICPPKernel *kernel, unsigned int split_dimension) = 0; + + /** Sets the target CPU architecture. + * + * @param[in] target Target CPU. + */ + void set_target(CPUTarget target); + + /** Return the current CPU target. + * + * @return Target CPU. + */ + CPUTarget target() const; + +protected: + CPUTarget _target; }; + +inline void IScheduler::set_target(CPUTarget target) +{ + _target = target; +} + +inline CPUTarget IScheduler::target() const +{ + return _target; +} } #endif /* __ARM_COMPUTE_ISCHEDULER_H__ */ -- cgit v1.2.1