ArmNN
 24.02
ClTensorDecorator Class Reference

ClTensorDecorator wraps an existing CL tensor allowing us to override the TensorInfo for it. More...

#include <ClTensorHandle.hpp>

Inheritance diagram for ClTensorDecorator:
[legend]
Collaboration diagram for ClTensorDecorator:
[legend]

Public Member Functions

 ClTensorDecorator ()
 
 ClTensorDecorator (arm_compute::ICLTensor *original, const TensorInfo &info)
 
 ~ClTensorDecorator ()=default
 
 ClTensorDecorator (const ClTensorDecorator &)=delete
 
ClTensorDecoratoroperator= (const ClTensorDecorator &)=delete
 
 ClTensorDecorator (ClTensorDecorator &&)=default
 
ClTensorDecoratoroperator= (ClTensorDecorator &&)=default
 
arm_compute::ICLTensor * parent ()
 
void map (bool blocking=true)
 
void unmap ()
 
virtual arm_compute::ITensorInfo * info () const override
 
virtual arm_compute::ITensorInfo * info () override
 
const cl::Buffer & cl_buffer () const override
 
arm_compute::CLQuantization quantization () const override
 

Protected Member Functions

uint8_t * do_map (cl::CommandQueue &q, bool blocking) override
 
void do_unmap (cl::CommandQueue &q) override
 

Detailed Description

ClTensorDecorator wraps an existing CL tensor allowing us to override the TensorInfo for it.

Definition at line 370 of file ClTensorHandle.hpp.

Constructor & Destructor Documentation

◆ ClTensorDecorator() [1/4]

Definition at line 20 of file ClTensorHandle.cpp.

21  : m_Original(nullptr), m_TensorInfo()
22  {
23  }

◆ ClTensorDecorator() [2/4]

ClTensorDecorator ( arm_compute::ICLTensor *  original,
const TensorInfo info 
)

Definition at line 25 of file ClTensorHandle.cpp.

26  : m_Original(nullptr), m_TensorInfo()
27  {
28  m_TensorInfo = armcomputetensorutils::BuildArmComputeTensorInfo(tensorInfo);
29  m_Original = original;
30  }

◆ ~ClTensorDecorator()

~ClTensorDecorator ( )
default

◆ ClTensorDecorator() [3/4]

ClTensorDecorator ( const ClTensorDecorator )
delete

◆ ClTensorDecorator() [4/4]

Member Function Documentation

◆ cl_buffer()

const cl::Buffer & cl_buffer ( ) const
override

Definition at line 42 of file ClTensorHandle.cpp.

43  {
44  ARM_COMPUTE_ERROR_ON(m_Original == nullptr);
45  return m_Original->cl_buffer();
46  }

◆ do_map()

uint8_t * do_map ( cl::CommandQueue &  q,
bool  blocking 
)
overrideprotected

Definition at line 68 of file ClTensorHandle.cpp.

69  {
70  if(m_Original->buffer() == nullptr)
71  {
72  m_Original->map(q, blocking);
73  }
74  return m_Original->buffer();
75  }

◆ do_unmap()

void do_unmap ( cl::CommandQueue &  q)
overrideprotected

Definition at line 77 of file ClTensorHandle.cpp.

78  {
79  m_Original->unmap(q);
80  }

◆ info() [1/2]

arm_compute::ITensorInfo * info ( ) const
overridevirtual

Definition at line 32 of file ClTensorHandle.cpp.

33  {
34  return &m_TensorInfo;
35  }

Referenced by ClTensorHandleDecorator::GetDataType(), and ClTensorHandleDecorator::Map().

◆ info() [2/2]

virtual arm_compute::ITensorInfo* info ( )
overridevirtual

◆ map()

void map ( bool  blocking = true)

Definition at line 58 of file ClTensorHandle.cpp.

59  {
60  arm_compute::ICLTensor::map(arm_compute::CLScheduler::get().queue(), blocking);
61  }

Referenced by ClTensorHandleDecorator::Map().

◆ operator=() [1/2]

ClTensorDecorator& operator= ( ClTensorDecorator &&  )
default

◆ operator=() [2/2]

ClTensorDecorator& operator= ( const ClTensorDecorator )
delete

◆ parent()

arm_compute::ICLTensor * parent ( )

Definition at line 48 of file ClTensorHandle.cpp.

49  {
50  return nullptr;
51  }

◆ quantization()

arm_compute::CLQuantization quantization ( ) const
override

Definition at line 53 of file ClTensorHandle.cpp.

54  {
55  return m_Original->quantization();
56  }

◆ unmap()

void unmap ( )

Definition at line 63 of file ClTensorHandle.cpp.

64  {
65  arm_compute::ICLTensor::unmap(arm_compute::CLScheduler::get().queue());
66  }

Referenced by ClTensorHandleDecorator::Unmap().


The documentation for this class was generated from the following files: