From db8485ac24135f17e9882c76196924435abc064f Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Tue, 24 Sep 2019 11:03:47 +0100 Subject: COMPMID-2205: CL runtime context. CL Interfaces implemented. Concrete classes implemented. One test (ActivationLayer) ported to the new interface. Change-Id: I283808bec36ccfc2f13fe048c45cbbee698ce525 Signed-off-by: Pablo Tello Reviewed-on: https://review.mlplatform.org/c/1998 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/ICLSimpleFunction.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'arm_compute/runtime/CL/ICLSimpleFunction.h') diff --git a/arm_compute/runtime/CL/ICLSimpleFunction.h b/arm_compute/runtime/CL/ICLSimpleFunction.h index 130c58a98c..8399a3d58e 100644 --- a/arm_compute/runtime/CL/ICLSimpleFunction.h +++ b/arm_compute/runtime/CL/ICLSimpleFunction.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -32,12 +32,25 @@ namespace arm_compute { +class CLRuntimeContext; /** Basic interface for functions which have a single OpenCL kernel */ class ICLSimpleFunction : public IFunction { public: - /** Default constructor */ - ICLSimpleFunction(); + /** Constructor + * + * @param[in] ctx Runtime context to be used by the function + */ + ICLSimpleFunction(CLRuntimeContext *ctx = nullptr); + + /** Prevent instances of this class from being copied (As this class contains pointers) */ + ICLSimpleFunction(const ICLSimpleFunction &) = delete; + /** Default move constructor */ + ICLSimpleFunction(ICLSimpleFunction &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + ICLSimpleFunction &operator=(const ICLSimpleFunction &) = delete; + /** Default move assignment operator */ + ICLSimpleFunction &operator=(ICLSimpleFunction &&) = default; // Inherited methods overridden: void run() override final; @@ -45,6 +58,7 @@ public: protected: std::unique_ptr _kernel; /**< Kernel to run */ CLFillBorderKernel _border_handler; /**< Kernel to handle borders */ + CLRuntimeContext *_ctx; /**< Context to use */ }; } #endif /*__ARM_COMPUTE_ICLSIMPLEFUNCTION_H__ */ -- cgit v1.2.1