Compute Library
 20.08
ITransformWeights Class Referenceabstract

Weights tensor transform interface In order to identify the different reshape functions, each reshape function has to generate a unique id. More...

#include <ITransformWeights.h>

Public Member Functions

 ITransformWeights ()=default
 Default Constructor. More...
 
virtual ~ITransformWeights ()=default
 Default Destructor. More...
 
 ITransformWeights (const ITransformWeights &)=delete
 Prevent instances of this class to be copy constructed. More...
 
ITransformWeightsoperator= (const ITransformWeights &)=delete
 Prevent instances of this class to be copied. More...
 
 ITransformWeights (ITransformWeights &&other)
 Allow instances of this class to be move constructed. More...
 
ITransformWeightsoperator= (ITransformWeights &&other)
 Allow instances of this class to be moved. More...
 
virtual ITensorget_weights ()=0
 Get a pointer to the transformed weights. More...
 
virtual uint32_t uid ()=0
 Function that returns a unique id of the reshape function. More...
 
virtual void run ()=0
 Run the transformation function. More...
 
virtual void release ()=0
 Release transformed weights memory. More...
 
void increase_refcount ()
 Increase the object's refcount. More...
 
int32_t decrease_refcount ()
 Decrease the object's refcount and return the updated value. More...
 
bool is_reshape_run ()
 Function that returns a flag on whether the weights are reshaped or not. More...
 

Detailed Description

Weights tensor transform interface In order to identify the different reshape functions, each reshape function has to generate a unique id.

We use the following conversion using an unsigned 32bit value:

Lower two bits store the target: 00 -> NEON 01 -> CL 10 -> GLES 11 -> Unused

Five bits store the id of the reshape function: 00000 -> FullyConnectedLayerReshapeWeights 00001 -> ConvertFullyConnectedWeights 00010 -> ConvolutionLayerReshapeWeights 00011 -> DepthwiseConvolutionLayerReshapeWeights 00100 -> GEMMReshapeLHSMatrixKernel 00101 -> GEMMReshapeRHSMatrixKernel

Rest of the bits are used for identifying special cases such as assembly functions and extra arguments in the reshape kernels.

Definition at line 56 of file ITransformWeights.h.

Constructor & Destructor Documentation

◆ ITransformWeights() [1/3]

ITransformWeights ( )
default

Default Constructor.

◆ ~ITransformWeights()

virtual ~ITransformWeights ( )
virtualdefault

Default Destructor.

◆ ITransformWeights() [2/3]

ITransformWeights ( const ITransformWeights )
delete

Prevent instances of this class to be copy constructed.

◆ ITransformWeights() [3/3]

ITransformWeights ( ITransformWeights &&  other)
inline

Allow instances of this class to be move constructed.

Definition at line 68 of file ITransformWeights.h.

69  {
70  *this = std::move(other);
71  }

Member Function Documentation

◆ decrease_refcount()

int32_t decrease_refcount ( )
inline

Decrease the object's refcount and return the updated value.

Returns
The updated refcount

Definition at line 107 of file ITransformWeights.h.

108  {
109  return --_num_refcount;
110  }

◆ get_weights()

◆ increase_refcount()

void increase_refcount ( )
inline

Increase the object's refcount.

Definition at line 98 of file ITransformWeights.h.

99  {
100  ++_num_refcount;
101  }

Referenced by IWeightsManager::acquire().

◆ is_reshape_run()

bool is_reshape_run ( )
inline

Function that returns a flag on whether the weights are reshaped or not.

Returns
True if the function is reshaped

Definition at line 116 of file ITransformWeights.h.

117  {
118  return _reshape_run;
119  }

◆ operator=() [1/2]

ITransformWeights& operator= ( const ITransformWeights )
delete

Prevent instances of this class to be copied.

◆ operator=() [2/2]

ITransformWeights& operator= ( ITransformWeights &&  other)
inline

Allow instances of this class to be moved.

Definition at line 73 of file ITransformWeights.h.

74  {
75  if(this != &other)
76  {
77  _num_refcount = other._num_refcount.load();
78  _reshape_run = other._reshape_run;
79  }
80  return *this;
81  }

◆ release()

◆ run()

◆ uid()


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