ArmNN
 25.11
Loading...
Searching...
No Matches
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 379 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 }

Referenced by ClTensorDecorator(), ClTensorDecorator(), operator=(), and operator=().

◆ 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() [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 }

◆ info() [2/2]

arm_compute::ITensorInfo * info ( )
overridevirtual

Definition at line 37 of file ClTensorHandle.cpp.

38 {
39 return &m_TensorInfo;
40 }

◆ 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 }

◆ operator=() [1/2]

ClTensorDecorator & operator= ( ClTensorDecorator && )
default

References ClTensorDecorator().

◆ operator=() [2/2]

ClTensorDecorator & operator= ( const ClTensorDecorator & )
delete

References ClTensorDecorator().

◆ 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 }

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