aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Antcliffe <gary.antcliffe@arm.com>2019-05-28 11:40:21 +0100
committerGary Antcliffe <gary.antcliffe@arm.com>2019-06-27 14:09:00 +0000
commitfffbdbcc52ae2f30b9c51637d82e5e1f5d604e71 (patch)
treeac2c43d7b69d61aed29a6ee3151806797e87f739
parentd8a468f90030edf7be512c00fce7230065456f61 (diff)
downloadComputeLibrary-fffbdbcc52ae2f30b9c51637d82e5e1f5d604e71.tar.gz
COMPUTE-10611: CL: Set config_id to enabling LWS tuning
Change-Id: Ie457ab751e1527841c3e2881a25eac889435a26e Signed-off-by: Gary Antcliffe <gary.antcliffe@arm.com> Reviewed-on: https://review.mlplatform.org/c/1408 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/core/CL/kernels/CLCannyEdgeKernel.cpp43
-rw-r--r--src/core/CL/kernels/CLColorConvertKernel.cpp50
-rw-r--r--src/core/CL/kernels/CLConvolutionKernel.cpp36
-rw-r--r--src/core/CL/kernels/CLDepthConvertLayerKernel.cpp13
-rw-r--r--src/core/CL/kernels/CLDerivativeKernel.cpp16
-rw-r--r--src/core/CL/kernels/CLFastCornersKernel.cpp34
-rw-r--r--src/core/CL/kernels/CLFillBorderKernel.cpp11
-rw-r--r--src/core/CL/kernels/CLGaussianPyramidKernel.cpp32
-rw-r--r--src/core/CL/kernels/CLHOGDescriptorKernel.cpp34
-rw-r--r--src/core/CL/kernels/CLHOGDetectorKernel.cpp14
-rw-r--r--src/core/CL/kernels/CLHarrisCornersKernel.cpp17
-rw-r--r--src/core/CL/kernels/CLHistogramKernel.cpp32
-rw-r--r--src/core/CL/kernels/CLIntegralImageKernel.cpp30
-rw-r--r--src/core/CL/kernels/CLMagnitudePhaseKernel.cpp14
-rw-r--r--src/core/CL/kernels/CLMedian3x3Kernel.cpp20
-rw-r--r--src/core/CL/kernels/CLSobel3x3Kernel.cpp16
-rw-r--r--src/core/CL/kernels/CLSobel5x5Kernel.cpp28
-rw-r--r--src/core/CL/kernels/CLSobel7x7Kernel.cpp27
-rw-r--r--src/core/CL/kernels/CLWarpAffineKernel.cpp29
19 files changed, 454 insertions, 42 deletions
diff --git a/src/core/CL/kernels/CLCannyEdgeKernel.cpp b/src/core/CL/kernels/CLCannyEdgeKernel.cpp
index 94e5e230f9..6e290ac148 100644
--- a/src/core/CL/kernels/CLCannyEdgeKernel.cpp
+++ b/src/core/CL/kernels/CLCannyEdgeKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -78,6 +78,15 @@ void CLGradientKernel::configure(const ICLTensor *gx, const ICLTensor *gy, ICLTe
phase_access.set_valid_region(win, _gx->info()->valid_region());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(gx->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(gx->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(gx->info()->dimension(1));
}
void CLGradientKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -124,7 +133,8 @@ void CLEdgeNonMaxSuppressionKernel::configure(const ICLTensor *magnitude, const
built_opts.emplace("-DDATA_TYPE_OUT=" + get_cl_type_from_data_type(output->info()->data_type()));
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("suppress_non_maximum", built_opts));
+ const std::string kernel_name = std::string("suppress_non_maximum");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, built_opts));
// Set minimum threshold argument
unsigned int idx = 3 * num_arguments_per_2D_tensor(); //Skip the input and output parameters
@@ -146,6 +156,17 @@ void CLEdgeNonMaxSuppressionKernel::configure(const ICLTensor *magnitude, const
output_access.set_valid_region(win, _magnitude->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(output->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLEdgeNonMaxSuppressionKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -195,7 +216,8 @@ void CLEdgeTraceKernel::configure(const ICLTensor *input, ICLTensor *output, int
built_opts.emplace("-DDATA_TYPE_OUT=" + get_cl_type_from_data_type(output->info()->data_type()));
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("hysteresis", built_opts));
+ const std::string kernel_name = std::string("hysteresis");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, built_opts));
// Set constant kernel args
unsigned int width = _input->info()->dimension(0);
@@ -231,6 +253,21 @@ void CLEdgeTraceKernel::configure(const ICLTensor *input, ICLTensor *output, int
l1_stack_counter_access.set_valid_region(win, _input->info()->valid_region());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += lower_string(string_from_format(output->info()->format()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
void CLEdgeTraceKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLColorConvertKernel.cpp b/src/core/CL/kernels/CLColorConvertKernel.cpp
index 4f178c9d75..c32c08f339 100644
--- a/src/core/CL/kernels/CLColorConvertKernel.cpp
+++ b/src/core/CL/kernels/CLColorConvertKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -125,6 +125,15 @@ void CLColorConvertKernel::configure(const ICLTensor *input, ICLTensor *output)
output_access.set_valid_region(win, input->info()->valid_region());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name.str();
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLImage *output)
@@ -195,6 +204,21 @@ void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLImage *outpu
output_access.set_valid_region(win, ValidRegion(intersect_region.anchor, output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name.str();
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->plane(0)->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(0)->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(0)->info()->dimension(1));
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->plane(1)->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(1)->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(1)->info()->dimension(1));
}
void CLColorConvertKernel::configure(const ICLImage *input, ICLMultiImage *output)
@@ -293,6 +317,15 @@ void CLColorConvertKernel::configure(const ICLImage *input, ICLMultiImage *outpu
output_plane2_access.set_valid_region(win, ValidRegion(input_region.anchor, output->plane(2)->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name.str();
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLMultiImage *output)
@@ -379,6 +412,21 @@ void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLMultiImage *
output_plane2_access.set_valid_region(win, ValidRegion(intersect_region.anchor, output->plane(2)->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name.str();
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->plane(0)->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(0)->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(0)->info()->dimension(1));
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->plane(1)->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(1)->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->plane(1)->info()->dimension(1));
}
void CLColorConvertKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLConvolutionKernel.cpp b/src/core/CL/kernels/CLConvolutionKernel.cpp
index d9c7ede068..ef2629d208 100644
--- a/src/core/CL/kernels/CLConvolutionKernel.cpp
+++ b/src/core/CL/kernels/CLConvolutionKernel.cpp
@@ -154,7 +154,8 @@ void CLSeparableConvolutionHorKernel<matrix_size>::configure(const ICLTensor *in
build_opts.insert("-DDATA_TYPE=" + get_cl_type_from_data_type(output->info()->data_type()));
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("convolution_separable1x" + support::cpp11::to_string(matrix_size) + "_static", build_opts));
+ const std::string kernel_name = "convolution_separable1x" + support::cpp11::to_string(matrix_size) + "_static";
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -171,6 +172,21 @@ void CLSeparableConvolutionHorKernel<matrix_size>::configure(const ICLTensor *in
output_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
template <unsigned int matrix_size>
@@ -212,7 +228,8 @@ void CLSeparableConvolutionVertKernel<matrix_size>::configure(const ICLTensor *i
build_opts.insert(out_type.str());
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("convolution_separable" + support::cpp11::to_string(matrix_size) + "x1_static", build_opts));
+ const std::string kernel_name = "convolution_separable" + support::cpp11::to_string(matrix_size) + "x1_static";
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -230,6 +247,21 @@ void CLSeparableConvolutionVertKernel<matrix_size>::configure(const ICLTensor *i
output_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(data_type));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
/****************************************************************************************\
diff --git a/src/core/CL/kernels/CLDepthConvertLayerKernel.cpp b/src/core/CL/kernels/CLDepthConvertLayerKernel.cpp
index e188ee92a8..14e5c98c0c 100644
--- a/src/core/CL/kernels/CLDepthConvertLayerKernel.cpp
+++ b/src/core/CL/kernels/CLDepthConvertLayerKernel.cpp
@@ -110,6 +110,19 @@ void CLDepthConvertLayerKernel::configure(const ICLTensor *input, ICLTensor *out
const Window &full_window = window();
Window collapsed_window = full_window.collapse_if_possible(full_window, Window::DimZ);
ICLKernel::configure_internal(collapsed_window);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
Status CLDepthConvertLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output, ConvertPolicy policy, uint32_t shift)
diff --git a/src/core/CL/kernels/CLDerivativeKernel.cpp b/src/core/CL/kernels/CLDerivativeKernel.cpp
index af7df14359..f55a4cc464 100644
--- a/src/core/CL/kernels/CLDerivativeKernel.cpp
+++ b/src/core/CL/kernels/CLDerivativeKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -83,7 +83,8 @@ void CLDerivativeKernel::configure(const ICLTensor *input, ICLTensor *output_x,
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("derivative", build_opts));
+ const std::string kernel_name = std::string("derivative");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 16;
@@ -118,6 +119,17 @@ void CLDerivativeKernel::configure(const ICLTensor *input, ICLTensor *output_x,
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLDerivativeKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLFastCornersKernel.cpp b/src/core/CL/kernels/CLFastCornersKernel.cpp
index 782ab7a7c0..ca3d528142 100644
--- a/src/core/CL/kernels/CLFastCornersKernel.cpp
+++ b/src/core/CL/kernels/CLFastCornersKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -67,7 +67,8 @@ void CLFastCornersKernel::configure(const ICLImage *input, ICLImage *output, flo
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("fast_corners", build_opts));
+ const std::string kernel_name = std::string("fast_corners");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Set static kernel arguments
unsigned int idx = 2 * num_arguments_per_2D_tensor(); // Skip the input and output parameters
@@ -88,6 +89,23 @@ void CLFastCornersKernel::configure(const ICLImage *input, ICLImage *output, flo
output_access.set_valid_region(win, input->info()->valid_region(), border_mode == BorderMode::UNDEFINED, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(non_max_suppression);
+ _config_id += "_";
+ _config_id += lower_string(string_from_border_mode(border_mode));
}
void CLFastCornersKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -131,7 +149,8 @@ void CLCopyToArrayKernel::configure(const ICLImage *input, bool update_number, I
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("copy_to_keypoint", build_opts));
+ const std::string kernel_name = std::string("copy_to_keypoint");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
//Get how many pixels skipped in the x dimension in the previous stages
unsigned int offset = _input->info()->valid_region().anchor.x();
@@ -149,6 +168,15 @@ void CLCopyToArrayKernel::configure(const ICLImage *input, bool update_number, I
update_window_and_padding(win,
AccessWindowHorizontal(input->info(), 0, num_elems_processed_per_iteration));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLCopyToArrayKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLFillBorderKernel.cpp b/src/core/CL/kernels/CLFillBorderKernel.cpp
index 5fdb826f8b..c63b3be9af 100644
--- a/src/core/CL/kernels/CLFillBorderKernel.cpp
+++ b/src/core/CL/kernels/CLFillBorderKernel.cpp
@@ -149,6 +149,17 @@ void CLFillBorderKernel::configure(ICLTensor *tensor, BorderSize border_size, Bo
win.set(Window::DimY, Window::Dimension(0, 1, 1));
win.use_tensor_dimensions(tensor->info()->tensor_shape(), Window::DimZ);
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(dt));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(tensor->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(tensor->info()->dimension(1));
+ _config_id += "_";
+ _config_id += lower_string(string_from_border_mode(border_mode));
}
void CLFillBorderKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
index c9c7bf39a9..27b73b6d32 100644
--- a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
+++ b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp
@@ -56,7 +56,8 @@ void CLGaussianPyramidHorKernel::configure(const ICLTensor *input, ICLTensor *ou
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("gaussian1x5_sub_x"));
+ const std::string kernel_name = std::string("gaussian1x5_sub_x");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 16;
@@ -96,6 +97,19 @@ void CLGaussianPyramidHorKernel::configure(const ICLTensor *input, ICLTensor *ou
output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
void CLGaussianPyramidHorKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -148,7 +162,8 @@ void CLGaussianPyramidVertKernel::configure(const ICLTensor *input, ICLTensor *o
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("gaussian5x1_sub_y"));
+ const std::string kernel_name = std::string("gaussian5x1_sub_y");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("gaussian5x1_sub_y"));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -178,6 +193,19 @@ void CLGaussianPyramidVertKernel::configure(const ICLTensor *input, ICLTensor *o
output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
void CLGaussianPyramidVertKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLHOGDescriptorKernel.cpp b/src/core/CL/kernels/CLHOGDescriptorKernel.cpp
index 26c3b81175..abdac504f5 100644
--- a/src/core/CL/kernels/CLHOGDescriptorKernel.cpp
+++ b/src/core/CL/kernels/CLHOGDescriptorKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -73,7 +73,8 @@ void CLHOGOrientationBinningKernel::configure(const ICLTensor *input_magnitude,
build_opts.insert(args_str.str());
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("hog_orientation_binning", build_opts));
+ const std::string kernel_name = std::string("hog_orientation_binning");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
constexpr unsigned int num_elems_processed_per_iteration = 1;
constexpr unsigned int num_elems_read_per_iteration = 1;
@@ -92,6 +93,19 @@ void CLHOGOrientationBinningKernel::configure(const ICLTensor *input_magnitude,
output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input_magnitude->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input_magnitude->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input_magnitude->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
void CLHOGOrientationBinningKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -156,7 +170,8 @@ void CLHOGBlockNormalizationKernel::configure(const ICLTensor *input, ICLTensor
std::set<std::string> build_opts = {};
build_opts.insert(args_str.str());
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("hog_block_normalization", build_opts));
+ const std::string kernel_name = std::string("hog_block_normalization");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
constexpr unsigned int num_elems_processed_per_iteration = 1;
constexpr unsigned int num_elems_read_per_iteration = 1;
@@ -175,6 +190,19 @@ void CLHOGBlockNormalizationKernel::configure(const ICLTensor *input, ICLTensor
output_access.set_valid_region(win, ValidRegion(Coordinates(), output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
void CLHOGBlockNormalizationKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLHOGDetectorKernel.cpp b/src/core/CL/kernels/CLHOGDetectorKernel.cpp
index 12bbbaf9f2..160be988f9 100644
--- a/src/core/CL/kernels/CLHOGDetectorKernel.cpp
+++ b/src/core/CL/kernels/CLHOGDetectorKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -80,7 +80,8 @@ void CLHOGDetectorKernel::configure(const ICLTensor *input, const ICLHOG *hog, I
build_opts.insert(args_str.str());
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("hog_detector", build_opts));
+ const std::string kernel_name = std::string("hog_detector");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Set static kernel arguments
unsigned int idx = num_arguments_per_2D_tensor(); // Skip the input parameters
@@ -111,6 +112,15 @@ void CLHOGDetectorKernel::configure(const ICLTensor *input, const ICLHOG *hog, I
update_window_and_padding(win, AccessWindowRectangle(input->info(), 0, 0, num_elems_read_per_iteration, num_rows_read_per_iteration));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLHOGDetectorKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLHarrisCornersKernel.cpp b/src/core/CL/kernels/CLHarrisCornersKernel.cpp
index 5320b6bebc..695e15d4b1 100644
--- a/src/core/CL/kernels/CLHarrisCornersKernel.cpp
+++ b/src/core/CL/kernels/CLHarrisCornersKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -107,6 +107,21 @@ void CLHarrisScoreKernel::configure(const ICLImage *input1, const ICLImage *inpu
output_access.set_valid_region(win, valid_region, border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = harris_score_kernel_name.str();
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input1->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input1->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input1->info()->dimension(1));
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input2->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input2->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input2->info()->dimension(1));
}
void CLHarrisScoreKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLHistogramKernel.cpp b/src/core/CL/kernels/CLHistogramKernel.cpp
index b56ad8d38d..302a5591c5 100644
--- a/src/core/CL/kernels/CLHistogramKernel.cpp
+++ b/src/core/CL/kernels/CLHistogramKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -81,9 +81,9 @@ void CLHistogramKernel::configure(const ICLImage *input, ICLDistribution1D *outp
unsigned int buffer_size = bin_size + 1; // We need one extra place for pixels that don't meet the conditions
// Create kernel
- bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange);
- std::string kernel_name = is_fixed_size ? "hist_local_kernel_fixed" : "hist_local_kernel";
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
+ bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange);
+ const std::string kernel_name = is_fixed_size ? "hist_local_kernel_fixed" : "hist_local_kernel";
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
// Set static kernel arguments
unsigned int idx = num_arguments_per_2D_tensor(); //Skip the input and output parameters
@@ -108,6 +108,15 @@ void CLHistogramKernel::configure(const ICLImage *input, ICLDistribution1D *outp
update_window_and_padding(win, AccessWindowHorizontal(input->info(), 0, pixels_per_item));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLHistogramKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -178,9 +187,9 @@ void CLHistogramBorderKernel::configure(const ICLImage *input, ICLDistribution1D
unsigned int offrange = offset + range;
// Create kernel
- bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange);
- std::string kernel_name = is_fixed_size ? "hist_border_kernel_fixed" : "hist_border_kernel";
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
+ bool is_fixed_size = (256 == num_bins) && (1 == window_size) && (0 == offset) && (256 == offrange);
+ const std::string kernel_name = is_fixed_size ? "hist_border_kernel_fixed" : "hist_border_kernel";
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
// Set static kernel arguments
unsigned int idx = num_arguments_per_2D_tensor(); //Skip the input and output parameters
@@ -199,6 +208,15 @@ void CLHistogramBorderKernel::configure(const ICLImage *input, ICLDistribution1D
win.set(1, Window::Dimension(0, _input->info()->dimension(1)));
update_window_and_padding(win, AccessWindowHorizontal(input->info(), 0, 1));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
}
void CLHistogramBorderKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLIntegralImageKernel.cpp b/src/core/CL/kernels/CLIntegralImageKernel.cpp
index 6fb39ff0a2..a1548a1223 100644
--- a/src/core/CL/kernels/CLIntegralImageKernel.cpp
+++ b/src/core/CL/kernels/CLIntegralImageKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -45,7 +45,8 @@ void CLIntegralImageHorKernel::configure(const ICLTensor *input, ICLTensor *outp
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("integral_horizontal"));
+ const std::string kernel_name = std::string("integral_horizontal");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
// Configure kernel window
const unsigned int num_elems_processed_per_iteration = input->info()->dimension(0);
@@ -61,6 +62,19 @@ void CLIntegralImageHorKernel::configure(const ICLTensor *input, ICLTensor *outp
output_access.set_valid_region(win, input->info()->valid_region());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
}
CLIntegralImageVertKernel::CLIntegralImageVertKernel()
@@ -75,7 +89,8 @@ void CLIntegralImageVertKernel::configure(ICLTensor *in_out)
_in_out = in_out;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("integral_vertical"));
+ const std::string kernel_name = std::string("integral_vertical");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration_x = 8;
@@ -90,6 +105,15 @@ void CLIntegralImageVertKernel::configure(ICLTensor *in_out)
in_out_access.set_valid_region(win, in_out->info()->valid_region());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(in_out->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(in_out->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(in_out->info()->dimension(1));
}
void CLIntegralImageVertKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLMagnitudePhaseKernel.cpp b/src/core/CL/kernels/CLMagnitudePhaseKernel.cpp
index 0b34c59a03..934e2d64a3 100644
--- a/src/core/CL/kernels/CLMagnitudePhaseKernel.cpp
+++ b/src/core/CL/kernels/CLMagnitudePhaseKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -116,7 +116,8 @@ void CLMagnitudePhaseKernel::configure(const ICLTensor *gx, const ICLTensor *gy,
build_opts.insert("-DDATA_TYPE=" + get_cl_type_from_data_type(gx->info()->data_type()));
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("magnitude_phase", build_opts));
+ const std::string kernel_name = std::string("magnitude_phase");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 16;
@@ -138,6 +139,15 @@ void CLMagnitudePhaseKernel::configure(const ICLTensor *gx, const ICLTensor *gy,
output_phase_access.set_valid_region(win, valid_region);
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(gx->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(gx->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(gx->info()->dimension(1));
}
void CLMagnitudePhaseKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLMedian3x3Kernel.cpp b/src/core/CL/kernels/CLMedian3x3Kernel.cpp
index b93179d5f4..5621118018 100644
--- a/src/core/CL/kernels/CLMedian3x3Kernel.cpp
+++ b/src/core/CL/kernels/CLMedian3x3Kernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -45,7 +45,8 @@ void CLMedian3x3Kernel::configure(const ICLTensor *input, ICLTensor *output, boo
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("non_linear_filter_box3x3", { "-DMEDIAN" }));
+ const std::string kernel_name = std::string("non_linear_filter_box3x3");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, { "-DMEDIAN" }));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -63,4 +64,19 @@ void CLMedian3x3Kernel::configure(const ICLTensor *input, ICLTensor *output, boo
output_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
diff --git a/src/core/CL/kernels/CLSobel3x3Kernel.cpp b/src/core/CL/kernels/CLSobel3x3Kernel.cpp
index b4bfe28216..4439b3073c 100644
--- a/src/core/CL/kernels/CLSobel3x3Kernel.cpp
+++ b/src/core/CL/kernels/CLSobel3x3Kernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -83,7 +83,8 @@ void CLSobel3x3Kernel::configure(const ICLTensor *input, ICLTensor *output_x, IC
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("sobel3x3", build_opts));
+ const std::string kernel_name = std::string("sobel3x3");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -103,6 +104,17 @@ void CLSobel3x3Kernel::configure(const ICLTensor *input, ICLTensor *output_x, IC
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLSobel3x3Kernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLSobel5x5Kernel.cpp b/src/core/CL/kernels/CLSobel5x5Kernel.cpp
index be2a44b079..1f4b496c75 100644
--- a/src/core/CL/kernels/CLSobel5x5Kernel.cpp
+++ b/src/core/CL/kernels/CLSobel5x5Kernel.cpp
@@ -84,7 +84,8 @@ void CLSobel5x5HorKernel::configure(const ICLTensor *input, ICLTensor *output_x,
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("sobel_separable1x5", build_opts));
+ const std::string kernel_name = std::string("sobel_separable1x5");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
// Configure kernel window
constexpr unsigned int num_elems_processed_per_iteration = 8;
@@ -103,6 +104,17 @@ void CLSobel5x5HorKernel::configure(const ICLTensor *input, ICLTensor *output_x,
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLSobel5x5HorKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -179,7 +191,8 @@ void CLSobel5x5VertKernel::configure(const ICLTensor *input_x, const ICLTensor *
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("sobel_separable5x1", build_opts));
+ const std::string kernel_name = std::string("sobel_separable5x1");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
const ICLTensor *input = _run_sobel_x ? _input_x : _input_y;
@@ -202,6 +215,17 @@ void CLSobel5x5VertKernel::configure(const ICLTensor *input_x, const ICLTensor *
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLSobel5x5VertKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLSobel7x7Kernel.cpp b/src/core/CL/kernels/CLSobel7x7Kernel.cpp
index a4a20c1863..cd221fc4aa 100644
--- a/src/core/CL/kernels/CLSobel7x7Kernel.cpp
+++ b/src/core/CL/kernels/CLSobel7x7Kernel.cpp
@@ -71,7 +71,7 @@ void CLSobel7x7HorKernel::configure(const ICLTensor *input, ICLTensor *output_x,
_border_size = BorderSize(border_undefined ? 0 : 3, 3);
// Construct kernel name
- std::string kernel_name = "sobel_separable1x7";
+ const std::string kernel_name = "sobel_separable1x7";
// Set build options
std::set<std::string> build_opts;
@@ -106,6 +106,17 @@ void CLSobel7x7HorKernel::configure(const ICLTensor *input, ICLTensor *output_x,
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLSobel7x7HorKernel::run(const Window &window, cl::CommandQueue &queue)
@@ -182,7 +193,8 @@ void CLSobel7x7VertKernel::configure(const ICLTensor *input_x, const ICLTensor *
}
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel("sobel_separable7x1", build_opts));
+ const std::string kernel_name = std::string("sobel_separable7x1");
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, build_opts));
const ICLTensor *input = _run_sobel_x ? _input_x : _input_y;
@@ -205,6 +217,17 @@ void CLSobel7x7VertKernel::configure(const ICLTensor *input_x, const ICLTensor *
output_y_access.set_valid_region(win, input->info()->valid_region(), border_undefined, border_size());
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(border_undefined);
}
void CLSobel7x7VertKernel::run(const Window &window, cl::CommandQueue &queue)
diff --git a/src/core/CL/kernels/CLWarpAffineKernel.cpp b/src/core/CL/kernels/CLWarpAffineKernel.cpp
index 1fae2b1974..684305ccd4 100644
--- a/src/core/CL/kernels/CLWarpAffineKernel.cpp
+++ b/src/core/CL/kernels/CLWarpAffineKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -75,8 +75,8 @@ void CLWarpAffineKernel::configure(const ICLTensor *input, ICLTensor *output, co
// Create kernel
std::string interpolation_name = string_from_interpolation_policy(policy);
std::transform(interpolation_name.begin(), interpolation_name.end(), interpolation_name.begin(), ::tolower);
- std::string kernel_name = "warp_affine_" + interpolation_name;
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, options));
+ const std::string kernel_name = "warp_affine_" + interpolation_name;
+ _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name, options));
// Set static kernel arguments
unsigned int idx = 2 * num_arguments_per_2D_tensor(); //Skip the input and output parameters
@@ -99,4 +99,27 @@ void CLWarpAffineKernel::configure(const ICLTensor *input, ICLTensor *output, co
output_access.set_valid_region(win, ValidRegion(Coordinates(), output->info()->tensor_shape()));
ICLKernel::configure_internal(win);
+
+ // Set config_id for enabling LWS tuning
+ _config_id = kernel_name;
+ _config_id += "_";
+ _config_id += lower_string(string_from_data_type(input->info()->data_type()));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(2));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(input->info()->dimension(3));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(0));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(1));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(2));
+ _config_id += "_";
+ _config_id += support::cpp11::to_string(output->info()->dimension(3));
+ _config_id += "_";
+ _config_id += lower_string(string_from_interpolation_policy(policy));
}