aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/Memory.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/Memory.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/Memory.h')
-rw-r--r--arm_compute/runtime/Memory.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/arm_compute/runtime/Memory.h b/arm_compute/runtime/Memory.h
index 98bbb70239..2dadccf254 100644
--- a/arm_compute/runtime/Memory.h
+++ b/arm_compute/runtime/Memory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,6 +24,8 @@
#ifndef __ARM_COMPUTE_MEMORY_H__
#define __ARM_COMPUTE_MEMORY_H__
+#include "arm_compute/runtime/IMemoryRegion.h"
+
#include <cstddef>
#include <memory>
@@ -37,11 +39,9 @@ public:
Memory();
/** Default Constructor
*
- * @note Ownership of the memory is transferred to this object
- *
* @param[in] memory Memory to be imported
*/
- Memory(std::shared_ptr<uint8_t> memory);
+ Memory(std::shared_ptr<IMemoryRegion> memory);
/** Default Constructor
*
* @note Ownership of the memory is not transferred to this object.
@@ -49,7 +49,7 @@ public:
*
* @param[in] memory Memory to be imported
*/
- Memory(uint8_t *memory);
+ Memory(IMemoryRegion *memory);
/** Allow instances of this class to be copied */
Memory(const Memory &) = default;
/** Allow instances of this class to be copy assigned */
@@ -58,26 +58,24 @@ public:
Memory(Memory &&) noexcept = default;
/** Allow instances of this class to be move assigned */
Memory &operator=(Memory &&) noexcept = default;
-
- /** Returns the pointer to the allocated data.
+ /** Region accessor
*
- * @return Pointer to the allocated data
+ * @return Memory region
*/
- uint8_t *buffer();
- /** Returns the pointer to the allocated data.
+ IMemoryRegion *region();
+ /** Region accessor
*
- * @return Pointer to the allocated data
+ * @return Memory region
*/
- uint8_t *buffer() const;
- /** Handle of internal memory
- *
- * @return Handle of memory
- */
- uint8_t **handle();
+ IMemoryRegion *region() const;
+
+private:
+ /** Creates empty region */
+ void create_empty_region();
private:
- uint8_t *_memory;
- std::shared_ptr<uint8_t> _memory_owned;
+ IMemoryRegion *_region;
+ std::shared_ptr<IMemoryRegion> _region_owned;
};
}
#endif /* __ARM_COMPUTE_MEMORY_H__ */