From 03c7ff3f6188240baaeaeb405a357a0c58195fec Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 22 Aug 2023 12:00:04 +0100 Subject: IVGCVSW-7702 Update Doxygen Docu for 23.08 Signed-off-by: Nikhil Raj Change-Id: I357a9f7e47614589327c1ac5d95b6224ff77103d --- ..._cl_backend_custom_allocator_memory_region.html | 347 +++++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 latest/classarmnn_1_1_cl_backend_1_1_cl_backend_custom_allocator_memory_region.html (limited to 'latest/classarmnn_1_1_cl_backend_1_1_cl_backend_custom_allocator_memory_region.html') diff --git a/latest/classarmnn_1_1_cl_backend_1_1_cl_backend_custom_allocator_memory_region.html b/latest/classarmnn_1_1_cl_backend_1_1_cl_backend_custom_allocator_memory_region.html new file mode 100644 index 0000000000..41b2bf4481 --- /dev/null +++ b/latest/classarmnn_1_1_cl_backend_1_1_cl_backend_custom_allocator_memory_region.html @@ -0,0 +1,347 @@ + + + + + + + + +Arm NN: ClBackend::ClBackendCustomAllocatorMemoryRegion Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ClBackend::ClBackendCustomAllocatorMemoryRegion Class Reference
+
+
+ +

#include <ClBackend.hpp>

+
+Inheritance diagram for ClBackend::ClBackendCustomAllocatorMemoryRegion:
+
+
+
+
[legend]
+
+Collaboration diagram for ClBackend::ClBackendCustomAllocatorMemoryRegion:
+
+
+
+
[legend]
+ + + + + + + + + + +

+Public Member Functions

 ClBackendCustomAllocatorMemoryRegion (const cl::Buffer &buffer, void *hostMemPtr, armnn::MemorySource source)
 
void * ptr () override
 
void * map (cl::CommandQueue &q, bool blocking) override
 
void unmap (cl::CommandQueue &q) override
 
+

Detailed Description

+
+

Definition at line 213 of file ClBackend.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ClBackendCustomAllocatorMemoryRegion()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
ClBackendCustomAllocatorMemoryRegion (const cl::Buffer & buffer,
void * hostMemPtr,
armnn::MemorySource source 
)
+
+inline
+
+ +

Definition at line 217 of file ClBackend.hpp.

+
218  : ICLMemoryRegion(buffer.getInfo<CL_MEM_SIZE>())
+
219  {
+
220  _mem = buffer;
+
221  m_HostMemPtr = hostMemPtr;
+
222  m_MemorySource = source;
+
223  }
+
+
+
+

Member Function Documentation

+ +

◆ map()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void* map (cl::CommandQueue & q,
bool blocking 
)
+
+inlineoverride
+
+ +

Definition at line 231 of file ClBackend.hpp.

+
232  {
+
233  armnn::IgnoreUnused(q, blocking);
+
234  if (m_HostMemPtr == nullptr)
+
235  {
+
236  throw armnn::Exception("ClBackend: Attempting to map memory with an invalid host ptr");
+
237  }
+
238  if (_mapping != nullptr)
+
239  {
+
240  throw armnn::Exception("ClBackend: Attempting to map memory which has not yet been unmapped");
+
241  }
+
242  switch (m_MemorySource)
+
243  {
+ +
245  _mapping = m_HostMemPtr;
+
246  return _mapping;
+
247  break;
+ + +
250  // If the source is a Dmabuf then the memory ptr should be pointing to an integer value for the fd
+
251  _mapping = mmap(NULL, _size, PROT_WRITE, MAP_SHARED, *(reinterpret_cast<int*>(m_HostMemPtr)), 0);
+
252  return _mapping;
+
253  break;
+
254  default:
+
255  throw armnn::Exception("ClBackend: Attempting to map imported memory without a valid source");
+
256  break;
+
257  }
+
258  }
+
+

References armnn::DmaBuf, armnn::DmaBufProtected, armnn::IgnoreUnused(), and armnn::Malloc.

+ +
+
+ +

◆ ptr()

+ +
+
+ + + + + +
+ + + + + + + +
void* ptr ()
+
+inlineoverride
+
+ +

Definition at line 226 of file ClBackend.hpp.

+
227  {
+
228  return nullptr;
+
229  }
+
+
+
+ +

◆ unmap()

+ +
+
+ + + + + +
+ + + + + + + + +
void unmap (cl::CommandQueue & q)
+
+inlineoverride
+
+ +

Definition at line 260 of file ClBackend.hpp.

+
261  {
+ +
263  switch (m_MemorySource)
+
264  {
+ +
266  _mapping = nullptr;
+
267  break;
+ + +
270  munmap(_mapping, _size);
+
271  _mapping = nullptr;
+
272  break;
+
273  default:
+
274  throw armnn::Exception("ClBackend: Attempting to unmap imported memory without a valid source");
+
275  break;
+
276  }
+
277  }
+
+

References armnn::DmaBuf, armnn::DmaBufProtected, armnn::IgnoreUnused(), and armnn::Malloc.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + +
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+
void IgnoreUnused(Ts &&...)
+ + + + -- cgit v1.2.1