aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLBufferAllocator.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/CLBufferAllocator.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/CLBufferAllocator.h')
-rw-r--r--arm_compute/runtime/CL/CLBufferAllocator.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/arm_compute/runtime/CL/CLBufferAllocator.h b/arm_compute/runtime/CL/CLBufferAllocator.h
index 19a3e627ca..772402270b 100644
--- a/arm_compute/runtime/CL/CLBufferAllocator.h
+++ b/arm_compute/runtime/CL/CLBufferAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -26,19 +26,25 @@
#include "arm_compute/runtime/IAllocator.h"
-#include "arm_compute/core/CL/OpenCL.h"
-#include "arm_compute/runtime/CL/CLScheduler.h"
-
#include <cstddef>
namespace arm_compute
{
+class CLCoreRuntimeContext;
/** Default OpenCL cl buffer allocator implementation */
class CLBufferAllocator final : public IAllocator
{
public:
- /** Default constructor */
- explicit CLBufferAllocator(cl::Context context = CLScheduler::get().context());
+ /** Default constructor
+ *
+ * @param[in] ctx A runtime context.
+ */
+ CLBufferAllocator(CLCoreRuntimeContext *ctx = nullptr);
+
+ /** Default copy constructor */
+ CLBufferAllocator(const CLBufferAllocator &) = default;
+ /** Default copy assignment operator */
+ CLBufferAllocator &operator=(const CLBufferAllocator &) = default;
// Inherited methods overridden:
void *allocate(size_t size, size_t alignment) override;
@@ -46,7 +52,7 @@ public:
std::unique_ptr<IMemoryRegion> make_region(size_t size, size_t alignment) override;
private:
- cl::Context _context;
+ CLCoreRuntimeContext *_ctx;
};
} // arm_compute
#endif /*__ARM_COMPUTE_CLBUFFERALLOCATOR_H__ */