24.02.1
|
Go to the documentation of this file.
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};
65 _impl->src_0 = input1;
66 _impl->src_1 = input2;
68 _impl->op = std::make_unique<opencl::ClAdd>();
69 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), policy,
act_info);
91 struct CLArithmeticSubtraction::Impl
94 const ICLTensor *src_1{
nullptr};
95 ICLTensor *
dst{
nullptr};
96 std::unique_ptr<opencl::ClSub> op{
nullptr};
122 _impl->src_0 = input1;
123 _impl->src_1 = input2;
125 _impl->op = std::make_unique<opencl::ClSub>();
126 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(), policy,
act_info);
145 _impl->op->run(
pack);
148 struct CLArithmeticDivision::Impl
151 const ICLTensor *src_1{
nullptr};
152 ICLTensor *
dst{
nullptr};
153 std::unique_ptr<opencl::ClElementwiseDivision> op{
nullptr};
177 _impl->src_0 = input1;
178 _impl->src_1 = input2;
180 _impl->op = std::make_unique<opencl::ClElementwiseDivision>();
181 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(),
act_info);
199 _impl->op->run(
pack);
202 struct CLElementwiseMax::Impl
205 const ICLTensor *src_1{
nullptr};
206 ICLTensor *
dst{
nullptr};
207 std::unique_ptr<opencl::ClElementwiseMax> op{
nullptr};
231 _impl->src_0 = input1;
232 _impl->src_1 = input2;
234 _impl->op = std::make_unique<opencl::ClElementwiseMax>();
235 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(),
act_info);
253 _impl->op->run(
pack);
256 struct CLElementwiseMin::Impl
259 const ICLTensor *src_1{
nullptr};
260 ICLTensor *
dst{
nullptr};
261 std::unique_ptr<opencl::ClElementwiseMin> op{
nullptr};
285 _impl->src_0 = input1;
286 _impl->src_1 = input2;
288 _impl->op = std::make_unique<opencl::ClElementwiseMin>();
289 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(),
act_info);
307 _impl->op->run(
pack);
310 struct CLElementwiseSquaredDiff::Impl
313 const ICLTensor *src_1{
nullptr};
314 ICLTensor *
dst{
nullptr};
315 std::unique_ptr<opencl::ClElementwiseSquaredDiff> op{
nullptr};
339 _impl->src_0 = input1;
340 _impl->src_1 = input2;
342 _impl->op = std::make_unique<opencl::ClElementwiseSquaredDiff>();
343 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(),
act_info);
361 _impl->op->run(
pack);
364 struct CLElementwisePower::Impl
367 const ICLTensor *src_1{
nullptr};
368 ICLTensor *
dst{
nullptr};
369 std::unique_ptr<opencl::ClElementwisePower> op{
nullptr};
393 _impl->src_0 = input1;
394 _impl->src_1 = input2;
396 _impl->op = std::make_unique<opencl::ClElementwisePower>();
397 _impl->op->configure(compile_context, input1->
info(), input2->
info(), output->
info(),
act_info);
415 _impl->op->run(
pack);
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.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
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.
~CLElementwiseSquaredDiff()
Default Destructor.
void run() override
Run the kernels contained in the function.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
~CLArithmeticSubtraction()
Default Destructor.
Basic function to run opencl::kernels::ClArithmeticKernel for min.
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.
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 *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.
CLElementwiseSquaredDiff()
Default Constructor.
CLElementwiseMin & operator=(const CLElementwiseMin &)=delete
Prevent instances of this class from being copied (As this class contains pointers)
Interface for OpenCL tensor.
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, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration.
CLElementwisePower()
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 *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.
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
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.
CLArithmeticDivision()
Default Constructor.
Basic function to run opencl::kernels::ClArithmeticKernel for max.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
CLElementwiseMin()
Default Constructor.
Manages all the OpenCL kernels compilation and caching, provides accessors for the OpenCL Context.
Activation Layer Information class.
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.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
~CLArithmeticAddition()
Default Destructor.
~CLElementwisePower()
Default Destructor.
CLElementwiseMax & operator=(const CLElementwiseMax &)=delete
Prevent instances of this class from being copied (As this class contains pointers)
CLArithmeticAddition & operator=(const CLArithmeticAddition &)=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.
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for division.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
~CLElementwiseMin()
Default Destructor.
CLArithmeticAddition()
Default Constructor.
void run() override
Run the kernels contained in the function.
CLElementwiseMax()
Default Constructor.
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 run() override
Run the kernels contained in the function.
CLArithmeticSubtraction()
Default Constructor.
CLElementwiseSquaredDiff & operator=(const CLElementwiseSquaredDiff &)=delete
Prevent instances of this class from being copied (As this class contains pointers)
~CLArithmeticDivision()
Default Destructor.
CLArithmeticSubtraction & operator=(const CLArithmeticSubtraction &)=delete
Prevent instances of this class from being copied (As this class contains pointers)
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for subtraction.
Copyright (c) 2017-2024 Arm Limited.
void run() override
Run the kernels contained in the function.
ConvertPolicy
Policy to handle integer overflow.
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.
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...
Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for addition.
CLElementwisePower & operator=(const CLElementwisePower &)=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.
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.
Store the tensor's metadata.
void run() override
Run the kernels contained in the function.
Basic function to run opencl::kernels::ClArithmeticKernel for squared difference.
Basic function to run opencl::kernels::ClArithmeticKernel for power.
void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, 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...
~CLElementwiseMax()
Default Destructor.
void run() override
Run the kernels contained in the function.