aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/IAllocator.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-04-23 16:26:46 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:50:15 +0000
commit99d40951df87790fb884ce1c42d5e2a7a0009ee0 (patch)
tree774e2c6d0849a7fb3f13c7cc4773f7cbfea448fb /arm_compute/runtime/IAllocator.h
parentcda0c38373b2f114509392ba16ef04e8c1e0f819 (diff)
downloadComputeLibrary-99d40951df87790fb884ce1c42d5e2a7a0009ee0.tar.gz
COMPMID-1023: Import memory for OpenCL
Change-Id: I201bc00a1261814737e6b6878ecfe9904bae0cc1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128212 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/runtime/IAllocator.h')
-rw-r--r--arm_compute/runtime/IAllocator.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/arm_compute/runtime/IAllocator.h b/arm_compute/runtime/IAllocator.h
index 3edb34a9ea..591ae0bff4 100644
--- a/arm_compute/runtime/IAllocator.h
+++ b/arm_compute/runtime/IAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,7 +24,10 @@
#ifndef __ARM_COMPUTE_IALLOCATOR_H__
#define __ARM_COMPUTE_IALLOCATOR_H__
+#include "arm_compute/runtime/IMemoryRegion.h"
+
#include <cstddef>
+#include <memory>
namespace arm_compute
{
@@ -34,6 +37,7 @@ class IAllocator
public:
/** Default virtual destructor. */
virtual ~IAllocator() = default;
+ // TODO (COMPMID-1088) : Change allocator and rest interfaces to use IMemoryRegion
/** Interface to be implemented by the child class to allocate bytes
*
* @param[in] size Size to allocate
@@ -44,6 +48,14 @@ public:
virtual void *allocate(size_t size, size_t alignment) = 0;
/** Interface to be implemented by the child class to free the allocated tensor */
virtual void free(void *ptr) = 0;
+ /** Create self-managed memory region
+ *
+ * @param[in] size Size of the memory region
+ * @param[in] alignment Alignment of the memory region
+ *
+ * @return The memory region object
+ */
+ virtual std::unique_ptr<IMemoryRegion> make_region(size_t size, size_t alignment) = 0;
};
} // arm_compute
#endif /*__ARM_COMPUTE_IALLOCATOR_H__ */