37 struct CLArithmeticAddition::Impl
39 const ICLTensor *src_0{
nullptr };
40 const ICLTensor *src_1{
nullptr };
41 ICLTensor *
dst{
nullptr };
42 std::unique_ptr<opencl::ClAdd> op{
nullptr };
46 : _impl(
std::make_unique<Impl>())
61 _impl->src_0 = input1;
62 _impl->src_1 = input2;
64 _impl->op = std::make_unique<opencl::ClAdd>();
65 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), policy, act_info);
83 struct CLArithmeticSubtraction::Impl
88 std::unique_ptr<opencl::ClSub> op{
nullptr };
92 : _impl(
std::make_unique<Impl>())
107 _impl->src_0 = input1;
108 _impl->src_1 = input2;
110 _impl->op = std::make_unique<opencl::ClSub>();
111 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), policy, act_info);
126 _impl->op->run(pack);
129 struct CLArithmeticDivision::Impl
134 std::unique_ptr<opencl::ClElementwiseDivision> op{
nullptr };
138 : _impl(
std::make_unique<Impl>())
152 _impl->src_0 = input1;
153 _impl->src_1 = input2;
155 _impl->op = std::make_unique<opencl::ClElementwiseDivision>();
156 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), act_info);
171 _impl->op->run(pack);
174 struct CLElementwiseMax::Impl
179 std::unique_ptr<opencl::ClElementwiseMax> op{
nullptr };
183 : _impl(
std::make_unique<Impl>())
197 _impl->src_0 = input1;
198 _impl->src_1 = input2;
200 _impl->op = std::make_unique<opencl::ClElementwiseMax>();
201 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), act_info);
216 _impl->op->run(pack);
219 struct CLElementwiseMin::Impl
224 std::unique_ptr<opencl::ClElementwiseMin> op{
nullptr };
228 : _impl(
std::make_unique<Impl>())
242 _impl->src_0 = input1;
243 _impl->src_1 = input2;
245 _impl->op = std::make_unique<opencl::ClElementwiseMin>();
246 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), act_info);
261 _impl->op->run(pack);
264 struct CLElementwiseSquaredDiff::Impl
269 std::unique_ptr<opencl::ClElementwiseSquaredDiff> op{
nullptr };
273 : _impl(
std::make_unique<Impl>())
287 _impl->src_0 = input1;
288 _impl->src_1 = input2;
290 _impl->op = std::make_unique<opencl::ClElementwiseSquaredDiff>();
291 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), act_info);
306 _impl->op->run(pack);
309 struct CLElementwisePower::Impl
314 std::unique_ptr<opencl::ClElementwisePower> op{
nullptr };
318 : _impl(
std::make_unique<Impl>())
332 _impl->src_0 = input1;
333 _impl->src_1 = input2;
335 _impl->op = std::make_unique<opencl::ClElementwisePower>();
336 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), act_info);
351 _impl->op->run(pack);
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of ClElementwiseDivision.
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClArith...
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for division.
void run() override
Run the kernels contained in the function.
~CLElementwisePower()
Default Destructor.
void run() override
Run the kernels contained in the function.
CLElementwiseMin()
Default Constructor.
Basic function to run opencl::kernels::ClArithmeticKernel for power.
Basic function to run opencl::kernels::ClArithmeticKernel for min.
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for addition.
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClArith...
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 opencl::kernels::ClArith...
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Store the tensor's metadata.
void run() override
Run the kernels contained in the function.
CLArithmeticDivision()
Default Constructor.
CLArithmeticDivision & operator=(const CLArithmeticDivision &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of ClSub.
Activation Layer Information class.
~CLElementwiseSquaredDiff()
Default Destructor.
void run() override
Run the kernels contained in the function.
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 CLArithmeticDivision.
~CLArithmeticAddition()
Default Destructor.
Copyright (c) 2017-2021 Arm Limited.
CLArithmeticSubtraction & operator=(const CLArithmeticSubtraction &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
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 opencl::kernels::ClArith...
void run() override
Run the kernels contained in the function.
CLArithmeticAddition & operator=(const CLArithmeticAddition &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
~CLElementwiseMin()
Default Destructor.
CLElementwiseMax()
Default Constructor.
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 opencl::kernels::ClArith...
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClSatur...
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
CLElementwisePower()
Default Constructor.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
CLArithmeticAddition()
Default Constructor.
void run() override
Run the kernels contained in the function.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClSatur...
CLElementwiseSquaredDiff & operator=(const CLElementwiseSquaredDiff &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
Basic function to run opencl::kernels::ClArithmeticKernel for max.
Interface for OpenCL tensor.
~CLArithmeticSubtraction()
Default Destructor.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
Basic function to run opencl::kernels::ClArithmeticKernel for squared difference. ...
~CLArithmeticDivision()
Default Destructor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context...
CLElementwiseSquaredDiff()
Default Constructor.
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 opencl::kernels::ClArith...
CLElementwiseMax & operator=(const CLElementwiseMax &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
CLArithmeticSubtraction()
Default Constructor.
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of ClAdd.
CLElementwiseMin & operator=(const CLElementwiseMin &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output.
CLElementwisePower & operator=(const CLElementwisePower &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for subtraction.
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClArith...
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of opencl::kernels::ClArith...
ConvertPolicy
Policy to handle overflow.
~CLElementwiseMax()
Default Destructor.
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.