Compute Library
 19.08
CLPixelWiseMultiplication Class Reference

Basic function to run CLPixelWiseMultiplicationKernel. More...

#include <CLPixelWiseMultiplication.h>

Collaboration diagram for CLPixelWiseMultiplication:
[legend]

Public Member Functions

void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy)
 Initialise the kernel's inputs, output and convertion policy. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction ()
 Default constructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy)
 Static function to check if given info will lead to a valid configuration of CLPixelWiseMultiplication. More...
 

Detailed Description

Basic function to run CLPixelWiseMultiplicationKernel.

Definition at line 36 of file CLPixelWiseMultiplication.h.

Member Function Documentation

◆ configure()

void configure ( ICLTensor input1,
ICLTensor input2,
ICLTensor output,
float  scale,
ConvertPolicy  overflow_policy,
RoundingPolicy  rounding_policy 
)

Initialise the kernel's inputs, output and convertion policy.

Parameters
[in,out]input1An input tensor. Data types supported: U8/QASYMM8/S16/QSYMM16/F16/F32. The input tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[in,out]input2An input tensor. Data types supported: same as input1. The input tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[out]outputThe output tensor, Data types supported: same as input1. Note: U8 requires both inputs to be U8.
[in]scaleScale to apply after multiplication. Scale must be positive and its value must be either 1/255 or 1/2^n where n is between 0 and 15.
[in]overflow_policyOverflow policy. Supported overflow policies: Wrap, Saturate
[in]rounding_policyRounding policy. Supported rounding modes: to zero, to nearest even.

Definition at line 34 of file CLPixelWiseMultiplication.cpp.

36 {
37  auto k = arm_compute::support::cpp14::make_unique<CLPixelWiseMultiplicationKernel>();
38  k->configure(input1, input2, output, scale, overflow_policy, rounding_policy);
39  _kernel = std::move(k);
40 
41  if(output->info()->dimension(0) > 1)
42  {
43  ICLTensor *broadcasted_info = (input1->info()->dimension(0) == 1) ? input1 : input2;
44 
45  if(broadcasted_info->info()->dimension(0) == 1)
46  {
47  _border_handler.configure(broadcasted_info, _kernel->border_size(), BorderMode::REPLICATE);
48  }
49  }
50 }
Pixels outside the image are assumed to have the same value as the closest image pixel.

References ITensorInfo::dimension(), ITensor::info(), arm_compute::REPLICATE, arm_compute::test::validation::rounding_policy, and arm_compute::test::validation::scale.

Referenced by CLLSTMLayerQuantized::configure().

◆ validate()

Status validate ( const ITensorInfo input1,
const ITensorInfo input2,
const ITensorInfo output,
float  scale,
ConvertPolicy  overflow_policy,
RoundingPolicy  rounding_policy 
)
static

Static function to check if given info will lead to a valid configuration of CLPixelWiseMultiplication.

Parameters
[in]input1An input tensor info. Data types supported: U8/QASYMM8/S16/QSYMM16/F16/F32.
[in]input2An input tensor info. Data types supported: same as input1.
[in]outputThe output tensor info, Data types supported: same as input1. Note: U8 requires both inputs to be U8.
[in]scaleScale to apply after multiplication. Scale must be positive and its value must be either 1/255 or 1/2^n where n is between 0 and 15.
[in]overflow_policyOverflow policy. Supported overflow policies: Wrap, Saturate
[in]rounding_policyRounding policy. Supported rounding modes: to zero, to nearest even.
Returns
a status

Definition at line 52 of file CLPixelWiseMultiplication.cpp.

54 {
55  return CLPixelWiseMultiplicationKernel::validate(input1, input2, output, scale, overflow_policy, rounding_policy);
56 }
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy)
Static function to check if given info will lead to a valid configuration of CLPixelWiseMultiplicatio...

References arm_compute::test::validation::rounding_policy, arm_compute::test::validation::scale, and CLPixelWiseMultiplicationKernel::validate().

Referenced by CLLSTMLayerQuantized::validate().


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