diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-07-11 15:00:49 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-07-12 09:29:37 +0000 |
commit | e1651a55c637708347c9adda4a77f1deffacf7d2 (patch) | |
tree | ad58c09a1a9b141b17ad108799b70727df3c1667 /arm_compute/core/CL/ICLKernel.h | |
parent | bffb41e06c1276af00e1605ef934d05fa61f7127 (diff) | |
download | ComputeLibrary-e1651a55c637708347c9adda4a77f1deffacf7d2.tar.gz |
COMPMID-2414 Add add_2D_tensor_argument_if for OpenCL
Change-Id: I8675b4b4face0be9416ae6c7a7023234d50fc0cb
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1524
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/CL/ICLKernel.h')
-rw-r--r-- | arm_compute/core/CL/ICLKernel.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arm_compute/core/CL/ICLKernel.h b/arm_compute/core/CL/ICLKernel.h index 590f8929cb..76b40b81d1 100644 --- a/arm_compute/core/CL/ICLKernel.h +++ b/arm_compute/core/CL/ICLKernel.h @@ -111,6 +111,20 @@ public: { add_tensor_argument<1>(idx, tensor, window); } + /** Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. + * + * @param[in] cond Condition to check + * @param[in,out] idx Index at which to start adding the tensor's arguments. Will be incremented by the number of kernel arguments set. + * @param[in] tensor Tensor to set as an argument of the object's kernel. + * @param[in] window Window the kernel will be executed on. + */ + void add_1D_tensor_argument_if(bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window) + { + if(cond) + { + add_1D_tensor_argument(idx, tensor, window); + } + } /** Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. * * @param[in,out] idx Index at which to start adding the tensor's arguments. Will be incremented by the number of kernel arguments set. @@ -121,6 +135,20 @@ public: { add_tensor_argument<2>(idx, tensor, window); } + /** Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx if the condition is true. + * + * @param[in] cond Condition to check + * @param[in,out] idx Index at which to start adding the tensor's arguments. Will be incremented by the number of kernel arguments set. + * @param[in] tensor Tensor to set as an argument of the object's kernel. + * @param[in] window Window the kernel will be executed on. + */ + void add_2D_tensor_argument_if(bool cond, unsigned int &idx, const ICLTensor *tensor, const Window &window) + { + if(cond) + { + add_2D_tensor_argument(idx, tensor, window); + } + } /** Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. * * @param[in,out] idx Index at which to start adding the tensor's arguments. Will be incremented by the number of kernel arguments set. |