Compute Library
 21.02
CLComplexPixelWiseMultiplication Class Reference

Basic function to run CLComplexPixelWiseMultiplicationKernel. More...

#include <CLPixelWiseMultiplication.h>

Collaboration diagram for CLComplexPixelWiseMultiplication:
[legend]

Public Member Functions

 CLComplexPixelWiseMultiplication ()
 Default Constructor. More...
 
 ~CLComplexPixelWiseMultiplication ()
 Default Destructor. More...
 
 CLComplexPixelWiseMultiplication (const CLComplexPixelWiseMultiplication &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLComplexPixelWiseMultiplication (CLComplexPixelWiseMultiplication &&)
 Default move constructor. More...
 
CLComplexPixelWiseMultiplicationoperator= (const CLComplexPixelWiseMultiplication &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLComplexPixelWiseMultiplicationoperator= (CLComplexPixelWiseMultiplication &&)
 Default move assignment operator. More...
 
void configure (ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Initialise the kernel's inputs, output. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Initialise the kernel's inputs, output. More...
 
void run () override
 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, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Static function to check if given info will lead to a valid configuration of CLComplexPixelWiseMultiplication. More...
 

Detailed Description

Basic function to run CLComplexPixelWiseMultiplicationKernel.

Definition at line 263 of file CLPixelWiseMultiplication.h.

Constructor & Destructor Documentation

◆ CLComplexPixelWiseMultiplication() [1/3]

Default Constructor.

Definition at line 184 of file CLPixelWiseMultiplication.cpp.

References CLComplexPixelWiseMultiplication::operator=(), and CLComplexPixelWiseMultiplication::~CLComplexPixelWiseMultiplication().

185  : _impl(std::make_unique<Impl>())
186 {
187 }

◆ ~CLComplexPixelWiseMultiplication()

◆ CLComplexPixelWiseMultiplication() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLComplexPixelWiseMultiplication() [3/3]

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( ICLTensor input1,
ICLTensor input2,
ICLTensor output,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)

Initialise the kernel's inputs, output.

Parameters
[in,out]input1An input tensor. Data types supported: F16/F32. Number of channels supported: 2. 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. Number of channels 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. Number of channels supported: same as input1.
[in]act_info(Optional) Activation layer information in case of a fused activation.

Definition at line 192 of file CLPixelWiseMultiplication.cpp.

References CLKernelLibrary::get().

Referenced by CLFFTConvolutionLayer::configure().

193 {
194  configure(CLKernelLibrary::get().get_compile_context(), input1, input2, output, act_info);
195 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel&#39;s inputs, output.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
ICLTensor input1,
ICLTensor input2,
ICLTensor output,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)

Initialise the kernel's inputs, output.

Parameters
[in]compile_contextThe compile context to be used.
[in,out]input1An input tensor. Data types supported: F16/F32. Number of channels supported: 2. 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. Number of channels 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. Number of channels supported: same as input1.
[in]act_info(Optional) Activation layer information in case of a fused activation.

Definition at line 197 of file CLPixelWiseMultiplication.cpp.

References ITensor::info().

198 {
199  _impl->src_0 = input1;
200  _impl->src_1 = input2;
201  _impl->dst = output;
202  _impl->op = std::make_unique<experimental::CLComplexPixelWiseMultiplication>();
203  _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), act_info);
204 }

◆ operator=() [1/2]

Prevent instances of this class from being copied (As this class contains pointers)

Referenced by CLComplexPixelWiseMultiplication::CLComplexPixelWiseMultiplication().

◆ operator=() [2/2]

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 211 of file CLPixelWiseMultiplication.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, and ITensorPack::add_tensor().

Referenced by CLFFTConvolutionLayer::run().

212 {
213  ITensorPack pack;
214  pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
215  pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
216  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
217 
218  _impl->op->run(pack);
219 }

◆ validate()

Status validate ( const ITensorInfo input1,
const ITensorInfo input2,
const ITensorInfo output,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)
static

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

Parameters
[in]input1An input tensor info. Data types supported: F16/F32. Number of channels supported: 2.
[in]input2An input tensor info. Data types supported: same as input1. Number of channels supported: same as input1.
[in]outputThe output tensor info, Data types supported: same as input1. Number of channels supported: same as input1.
[in]act_info(Optional) Activation layer information in case of a fused activation.

Definition at line 206 of file CLPixelWiseMultiplication.cpp.

References CLComplexPixelWiseMultiplication::validate().

207 {
208  return experimental::CLComplexPixelWiseMultiplication::validate(input1, input2, output, act_info);
209 }
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of CLComplexPixelWiseMultip...

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