From 99d40951df87790fb884ce1c42d5e2a7a0009ee0 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 23 Apr 2018 16:26:46 +0100 Subject: COMPMID-1023: Import memory for OpenCL Change-Id: I201bc00a1261814737e6b6878ecfe9904bae0cc1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128212 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- arm_compute/runtime/Memory.h | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'arm_compute/runtime/Memory.h') 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 #include @@ -36,12 +38,10 @@ public: /** Default Constructor */ Memory(); /** Default Constructor - * - * @note Ownership of the memory is transferred to this object * * @param[in] memory Memory to be imported */ - Memory(std::shared_ptr memory); + Memory(std::shared_ptr 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 _memory_owned; + IMemoryRegion *_region; + std::shared_ptr _region_owned; }; } #endif /* __ARM_COMPUTE_MEMORY_H__ */ -- cgit v1.2.1