Compute Library
 22.08
DepthwiseDepthfirstGenericWithMultiplierQuantized< strategy > Class Template Reference

#include <depthwise_depthfirst_generic_multiplier_quantized.hpp>

Collaboration diagram for DepthwiseDepthfirstGenericWithMultiplierQuantized< strategy >:
[legend]

Public Member Functions

 DepthwiseDepthfirstGenericWithMultiplierQuantized (const DepthwiseArgs &args, const arm_gemm::Requantize32 &qp)
 
 DepthwiseDepthfirstGenericWithMultiplierQuantized (DepthwiseDepthfirstGenericWithMultiplierQuantized &)=delete
 
DepthwiseDepthfirstGenericWithMultiplierQuantizedoperator= (DepthwiseDepthfirstGenericWithMultiplierQuantized &)=delete
 
void pack_parameters (void *buffer, const void *biases, const void *weights, size_t ld_weight_col, size_t ld_weight_row) override
 
void execute (const unsigned int batches, const unsigned int input_height, const unsigned int input_width, const unsigned int input_channels, const PaddingValues &padding, const void *const _input, const size_t ld_input_col, const size_t ld_input_row, const size_t ld_input_batch, const void *const parameters, const unsigned int output_height, const unsigned int output_width, void *const _output, const size_t ld_output_col, const size_t ld_output_row, const size_t ld_output_batch, void *const _working_space, const unsigned int thread_id, const unsigned int n_threads) const override
 
- Public Member Functions inherited from DepthwiseDepthfirstGenericWithMultiplierBase< strategy >
 DepthwiseDepthfirstGenericWithMultiplierBase (const DepthwiseArgs &args)
 
 DepthwiseDepthfirstGenericWithMultiplierBase (DepthwiseDepthfirstGenericWithMultiplierBase &)=delete
 
DepthwiseDepthfirstGenericWithMultiplierBaseoperator= (DepthwiseDepthfirstGenericWithMultiplierBase &)=delete
 
size_t get_storage_size (void) const override
 
size_t get_working_size (const unsigned int n_threads, const unsigned int n_channels) const override
 

Detailed Description

template<class strategy>
class arm_conv::depthwise::DepthwiseDepthfirstGenericWithMultiplierQuantized< strategy >

Definition at line 39 of file depthwise_depthfirst_generic_multiplier_quantized.hpp.

Constructor & Destructor Documentation

◆ DepthwiseDepthfirstGenericWithMultiplierQuantized() [1/2]

DepthwiseDepthfirstGenericWithMultiplierQuantized ( const DepthwiseArgs &  args,
const arm_gemm::Requantize32 qp 
)
inline

◆ DepthwiseDepthfirstGenericWithMultiplierQuantized() [2/2]

Member Function Documentation

◆ execute()

void execute ( const unsigned int  batches,
const unsigned int  input_height,
const unsigned int  input_width,
const unsigned int  input_channels,
const PaddingValues &  padding,
const void *const  _input,
const size_t  ld_input_col,
const size_t  ld_input_row,
const size_t  ld_input_batch,
const void *const  parameters,
const unsigned int  output_height,
const unsigned int  output_width,
void *const  _output,
const size_t  ld_output_col,
const size_t  ld_output_row,
const size_t  ld_output_batch,
void *const  _working_space,
const unsigned int  thread_id,
const unsigned int  n_threads 
) const
inlineoverride

Definition at line 66 of file depthwise_depthfirst_generic_multiplier_quantized.hpp.

References Requantize32::a_offset, Requantize32::bias, Requantize32::per_channel_left_shifts, Requantize32::per_channel_muls, Requantize32::per_channel_right_shifts, and strategy.

87  {
88  strategy strat(this->m_args.cpu_info);
89 #ifdef CYCLE_PROFILING
90  arm_gemm::profiler prof;
91 #endif
92 
93  // Get a function to call for each point of the output
94  auto tile_fn = [&] (const TInput **inptrs,
95  TOutput **outptrs,
96  const TWeight *weights,
97  const unsigned int,
98  const unsigned int start_output_channel) {
99 #ifdef CYCLE_PROFILING
100  auto p = prof.ScopedProfiler(PROFILE_KERNEL, (unsigned long)(strategy::output_rows() * strategy::output_cols() * this->m_args.channel_multiplier * this->m_args.kernel_rows * this->m_args.kernel_cols));
101 #endif
102  strat.kernel(
103  inptrs, outptrs, weights,
104  m_qp.bias == nullptr ? nullptr : m_qp.bias + start_output_channel,
105  this->kernel_points(),
106  this->m_args.channel_multiplier,
107  m_qp.per_channel_left_shifts == nullptr ? nullptr : m_qp.per_channel_left_shifts + start_output_channel,
108  m_qp.per_channel_muls == nullptr ? nullptr : m_qp.per_channel_muls + start_output_channel,
109  m_qp.per_channel_right_shifts == nullptr ? nullptr : m_qp.per_channel_right_shifts + start_output_channel,
110  m_qp
111  );
112  };
113 
114  Parent::execute_tiles(
115  tile_fn, m_qp.a_offset,
116  batches, input_height, input_width, input_channels, padding,
117  _input, ld_input_col, ld_input_row, ld_input_batch,
118  parameters,
119  output_height, output_width,
120  _output, ld_output_col, ld_output_row, ld_output_batch,
121  _working_space, thread_id, n_threads
122  );
123  }
const int32_t * bias
Definition: arm_gemm.hpp:172
const int32_t * per_channel_left_shifts
Definition: arm_gemm.hpp:181
const size_t input_height
Definition: impl.cpp:61
const size_t input_width
Definition: impl.cpp:62
std::unique_ptr< ParametersLibrary > parameters
Definition: Framework.cpp:46
const StratType * strategy
const int32_t * per_channel_right_shifts
Definition: arm_gemm.hpp:182
unsigned int batches
const int32_t * per_channel_muls
Definition: arm_gemm.hpp:183

◆ operator=()

◆ pack_parameters()

void pack_parameters ( void *  buffer,
const void *  biases,
const void *  weights,
size_t  ld_weight_col,
size_t  ld_weight_row 
)
inlineoverride

Definition at line 59 of file depthwise_depthfirst_generic_multiplier_quantized.hpp.

References Requantize32::bias.

60  {
61  m_qp.bias = static_cast<const TAccum *>(biases);
62  Parent::pack_weights(static_cast<TWeight *>(buffer), static_cast<const TWeight *>(weights), ld_weight_col, ld_weight_row);
63  }
const int32_t * bias
Definition: arm_gemm.hpp:172

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