diff options
Diffstat (limited to 'arm_compute/runtime/CL/CLTensor.h')
-rw-r--r-- | arm_compute/runtime/CL/CLTensor.h | 27 |
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 */ |