aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLTensor.h
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-09-24 11:03:47 +0100
committerPablo Marquez <pablo.tello@arm.com>2019-10-15 14:05:55 +0000
commitdb8485ac24135f17e9882c76196924435abc064f (patch)
treedfe4ff6a50012ac93c6b1cf3fb29c099a7592522 /arm_compute/runtime/CL/CLTensor.h
parenta046e164b96a8441b2fa14ef578f7db46a0e97da (diff)
downloadComputeLibrary-db8485ac24135f17e9882c76196924435abc064f.tar.gz
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 <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/c/1998 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/CLTensor.h')
-rw-r--r--arm_compute/runtime/CL/CLTensor.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/arm_compute/runtime/CL/CLTensor.h b/arm_compute/runtime/CL/CLTensor.h
index bc72839492..c108d1afad 100644
--- a/arm_compute/runtime/CL/CLTensor.h
+++ b/arm_compute/runtime/CL/CLTensor.h
@@ -35,13 +35,32 @@ namespace arm_compute
// Forward declarations
class ITensorAllocator;
class ITensorInfo;
-
+class IRuntimeContext;
+class CLRuntimeContext;
/** Basic implementation of the OpenCL tensor interface */
class CLTensor : public ICLTensor, public IMemoryManageable
{
public:
- /** Constructor */
- CLTensor();
+ /** Constructor.
+ *
+ * @param[in] ctx (Optional) Pointer to a @ref CLRuntimeContext.
+ * If nullptr is passed in, the legacy api using the singletons will be used. Otherwise the memory for the
+ * tensor will allocate on the context passed in.
+ * The singletons legacy api has been deprecated and will be removed.
+ */
+ CLTensor(IRuntimeContext *ctx = nullptr);
+
+ /** Destructor */
+ ~CLTensor() = default;
+ /** Default copy constructor */
+ CLTensor(const CLTensor &) = default;
+ /** Default move constructor */
+ CLTensor(CLTensor &&) = default;
+ /** Default copy assignment */
+ CLTensor &operator=(const CLTensor &) = default;
+ /** Default move assignment operator */
+ CLTensor &operator=(CLTensor &&) = default;
+
/** Return a pointer to the tensor's allocator
*
* @return A pointer to the tensor's allocator
@@ -69,6 +88,7 @@ public:
const cl::Buffer &cl_buffer() const override;
CLQuantization quantization() const override;
void associate_memory_group(IMemoryGroup *memory_group) override;
+ CLRuntimeContext *context();
protected:
// Inherited methods overridden:
@@ -77,6 +97,7 @@ protected:
private:
mutable CLTensorAllocator _allocator; /**< Instance of the OpenCL tensor allocator */
+ CLRuntimeContext *_ctx{ nullptr };
};
/** OpenCL Image */