aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLSobel5x5Kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/kernels/CLSobel5x5Kernel.cpp')
-rw-r--r--src/core/CL/kernels/CLSobel5x5Kernel.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/core/CL/kernels/CLSobel5x5Kernel.cpp b/src/core/CL/kernels/CLSobel5x5Kernel.cpp
index f07c1c9098..09ccf140c6 100644
--- a/src/core/CL/kernels/CLSobel5x5Kernel.cpp
+++ b/src/core/CL/kernels/CLSobel5x5Kernel.cpp
@@ -127,16 +127,8 @@ void CLSobel5x5HorKernel::run(const Window &window, cl::CommandQueue &queue)
{
unsigned int idx = 0;
add_2D_tensor_argument(idx, _input, slice);
-
- if(_run_sobel_x)
- {
- add_2D_tensor_argument(idx, _output_x, slice);
- }
-
- if(_run_sobel_y)
- {
- add_2D_tensor_argument(idx, _output_y, slice);
- }
+ add_2D_tensor_argument_if((_run_sobel_x), idx, _output_x, slice);
+ add_2D_tensor_argument_if((_run_sobel_y), idx, _output_y, slice);
enqueue(queue, *this, slice, lws_hint());
}
@@ -237,18 +229,10 @@ void CLSobel5x5VertKernel::run(const Window &window, cl::CommandQueue &queue)
do
{
unsigned int idx = 0;
-
- if(_run_sobel_x)
- {
- add_2D_tensor_argument(idx, _input_x, slice);
- add_2D_tensor_argument(idx, _output_x, slice);
- }
-
- if(_run_sobel_y)
- {
- add_2D_tensor_argument(idx, _input_y, slice);
- add_2D_tensor_argument(idx, _output_y, slice);
- }
+ add_2D_tensor_argument_if((_run_sobel_x), idx, _input_x, slice);
+ add_2D_tensor_argument_if((_run_sobel_x), idx, _output_x, slice);
+ add_2D_tensor_argument_if((_run_sobel_y), idx, _input_y, slice);
+ add_2D_tensor_argument_if((_run_sobel_y), idx, _output_y, slice);
_kernel.setArg(idx++, 0 /*dummy*/);