aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLColorConvertKernel.cpp
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2020-04-08 10:15:51 +0100
committerManuel Bottini <manuel.bottini@arm.com>2020-04-17 14:10:38 +0000
commit4c6bd514a8d424a29b776754f1b3426fa3a8c339 (patch)
treeed20ea238ae069ab138b62ea6879e0c1b955b606 /src/core/CL/kernels/CLColorConvertKernel.cpp
parentd2f6d96cdc2ad2169c4abd0a8c4884f61ed6d186 (diff)
downloadComputeLibrary-4c6bd514a8d424a29b776754f1b3426fa3a8c339.tar.gz
COMPMID-3280: Make all ML primitives for CL use the new interface - Part 1
- Only CLKernels have been updated Change-Id: Ife55b847c2e39e712a186eb6ca452503d5b66937 Signed-off-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3001 Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLColorConvertKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLColorConvertKernel.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/core/CL/kernels/CLColorConvertKernel.cpp b/src/core/CL/kernels/CLColorConvertKernel.cpp
index f2eb848684..720d925427 100644
--- a/src/core/CL/kernels/CLColorConvertKernel.cpp
+++ b/src/core/CL/kernels/CLColorConvertKernel.cpp
@@ -48,6 +48,11 @@ CLColorConvertKernel::CLColorConvertKernel()
void CLColorConvertKernel::configure(const ICLTensor *input, ICLTensor *output)
{
+ configure(CLKernelLibrary::get().get_compile_context(), input, output);
+}
+
+void CLColorConvertKernel::configure(CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output)
+{
ARM_COMPUTE_ERROR_ON(input == nullptr);
ARM_COMPUTE_ERROR_ON(output == nullptr);
@@ -114,7 +119,7 @@ void CLColorConvertKernel::configure(const ICLTensor *input, ICLTensor *output)
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name.str()));
+ _kernel = create_kernel(compile_context, kernel_name.str());
// Configure kernel window
Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration));
@@ -139,6 +144,11 @@ void CLColorConvertKernel::configure(const ICLTensor *input, ICLTensor *output)
void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLImage *output)
{
+ configure(CLKernelLibrary::get().get_compile_context(), input, output);
+}
+
+void CLColorConvertKernel::configure(CLCompileContext &compile_context, const ICLMultiImage *input, ICLImage *output)
+{
ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(output);
ARM_COMPUTE_ERROR_ON(output == nullptr);
@@ -180,7 +190,7 @@ void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLImage *outpu
_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name.str()));
+ _kernel = create_kernel(compile_context, kernel_name.str());
// Configure kernel window
const bool has_two_planes = (input->info()->format() == Format::NV12) || (input->info()->format() == Format::NV21);
@@ -224,6 +234,11 @@ void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLImage *outpu
void CLColorConvertKernel::configure(const ICLImage *input, ICLMultiImage *output)
{
+ configure(CLKernelLibrary::get().get_compile_context(), input, output);
+}
+
+void CLColorConvertKernel::configure(CLCompileContext &compile_context, const ICLImage *input, ICLMultiImage *output)
+{
ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(input);
ARM_COMPUTE_ERROR_ON(output == nullptr);
@@ -289,7 +304,7 @@ void CLColorConvertKernel::configure(const ICLImage *input, ICLMultiImage *outpu
_multi_output = output;
// Create kernel
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name.str()));
+ _kernel = create_kernel(compile_context, kernel_name.str());
// Configure kernel window
Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration));
@@ -331,6 +346,11 @@ void CLColorConvertKernel::configure(const ICLImage *input, ICLMultiImage *outpu
void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLMultiImage *output)
{
+ configure(CLKernelLibrary::get().get_compile_context(), input, output);
+}
+
+void CLColorConvertKernel::configure(CLCompileContext &compile_context, const ICLMultiImage *input, ICLMultiImage *output)
+{
unsigned int num_elems_processed_per_iteration = 0;
switch(input->info()->format())
{
@@ -387,7 +407,7 @@ void CLColorConvertKernel::configure(const ICLMultiImage *input, ICLMultiImage *
float sub_sampling_input = (has_two_input_planars || (input->info()->format() == Format::IYUV)) ? 0.5f : 1;
float sub_sampling_output = (has_two_output_planars || (output->info()->format() == Format::IYUV)) ? 0.5f : 1;
- _kernel = static_cast<cl::Kernel>(CLKernelLibrary::get().create_kernel(kernel_name.str()));
+ _kernel = create_kernel(compile_context, kernel_name.str());
Window win = calculate_max_window(*input->cl_plane(0)->info(), Steps(num_elems_processed_per_iteration));
win.set_dimension_step(Window::DimY, 2);