Compute Library
 22.08
DepthwiseDepthfirstGenericWithMultiplier< strategy > Class Template Reference

#include <depthwise_depthfirst_generic_multiplier.hpp>

Collaboration diagram for DepthwiseDepthfirstGenericWithMultiplier< strategy >:
[legend]

Public Member Functions

 DepthwiseDepthfirstGenericWithMultiplier (const DepthwiseArgs &args)
 
 DepthwiseDepthfirstGenericWithMultiplier (DepthwiseDepthfirstGenericWithMultiplier &)=delete
 
DepthwiseDepthfirstGenericWithMultiplieroperator= (DepthwiseDepthfirstGenericWithMultiplier &)=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::DepthwiseDepthfirstGenericWithMultiplier< strategy >

Definition at line 373 of file depthwise_depthfirst_generic_multiplier.hpp.

Constructor & Destructor Documentation

◆ DepthwiseDepthfirstGenericWithMultiplier() [1/2]

DepthwiseDepthfirstGenericWithMultiplier ( const DepthwiseArgs &  args)
inline

Definition at line 385 of file depthwise_depthfirst_generic_multiplier.hpp.

References DepthwiseDepthfirstGenericWithMultiplierBase< strategy >::operator=().

386  : Parent(args), m_biases(nullptr)
387  {
388  }

◆ DepthwiseDepthfirstGenericWithMultiplier() [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 400 of file depthwise_depthfirst_generic_multiplier.hpp.

References activation_max, activation_min, Activation::BoundedReLU, Activation::ReLU, and strategy.

421  {
422  strategy strat(this->m_args.cpu_info);
423 #ifdef CYCLE_PROFILING
424  arm_gemm::profiler prof;
425 #endif
426 
427  // Compute activation values
429  std::tie(activation_min, activation_max) = get_default_activation_values<TAccum>();
430 
431  switch (this->m_args.activation.type)
432  {
434  activation_max = static_cast<TAccum>(this->m_args.activation.param1);
435  // Fall through
437  activation_min = static_cast<TAccum>(0);
438  break;
439  default:
440  break;
441  }
442 
443  // Get a function to call for each point of the output
444  auto tile_fn = [&] (const TInput **inptrs,
445  TOutput **outptrs,
446  const TWeight *weights,
447  const unsigned int,
448  const unsigned int start_output_channel) {
449 #ifdef CYCLE_PROFILING
450  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));
451 #endif
452  strat.kernel(
453  inptrs, outptrs, weights,
454  m_biases ? m_biases + start_output_channel : nullptr,
455  this->kernel_points(), this->m_args.channel_multiplier,
456  activation_min, activation_max
457  );
458  };
459 
460  Parent::execute_tiles(
461  tile_fn, 0.0f,
462  batches, input_height, input_width, input_channels, padding,
463  _input, ld_input_col, ld_input_row, ld_input_batch,
464  parameters,
465  output_height, output_width,
466  _output, ld_output_col, ld_output_row, ld_output_batch,
467  _working_space, thread_id, n_threads
468  );
469  }
T activation_min
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
T activation_max
unsigned int batches

◆ 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 393 of file depthwise_depthfirst_generic_multiplier.hpp.

394  {
395  m_biases = static_cast<const TAccum *>(biases);
396  Parent::pack_weights(static_cast<TAccum *>(buffer), static_cast<const TWeight *>(weights), ld_weight_col, ld_weight_row);
397  }

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