From 76335eb8d8733b0bbc0110546797211540870c50 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 17 Nov 2022 11:03:39 +0000 Subject: Implement the OpenCL kernel to compute the indirect convolution - Implement indirect convolution kernel - Add operator support - Add test Resolves COMPMID-5709 Change-Id: I9272304163471a5a40da7fdec204599f3c1d8e32 Signed-off-by: Gian Marco Iodice Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8701 Comments-Addressed: Arm Jenkins Reviewed-by: Gunes Bayir Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp') diff --git a/src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp b/src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp index 95186fe106..8e12f23fa6 100644 --- a/src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp +++ b/src/gpu/cl/kernels/ClIndirectConv2dAddressPrecalculationKernel.cpp @@ -80,8 +80,8 @@ void ClIndirectConv2dAddressPrecalculationKernel::configure(const CLCompileConte ARM_COMPUTE_ERROR_ON_NULLPTR(src, weights, dst); ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, weights, dst, conv_info, desc)); - constexpr unsigned int width_idx = 1; - constexpr unsigned int height_idx = 2; + constexpr unsigned int width_idx = 1; + constexpr unsigned int height_idx = 2; // Get dst shape TensorShape output_shape = misc::shape_calculator::compute_indirect_buffer_shape(src->tensor_shape(), @@ -127,6 +127,9 @@ void ClIndirectConv2dAddressPrecalculationKernel::configure(const CLCompileConte build_options.add_option("-DPAD_TOP=" + support::cpp11::to_string(pad_top)); build_options.add_option("-DM0=" + support::cpp11::to_string(desc.m0)); + // A macro guard to compile ONLY the kernel of interest + build_options.add_option("-D" + upper_string(kernel_name.str())); + _kernel = create_kernel(compile_context, kernel_name.str(), build_options.options()); // Since this kernel should be called only once, we do not need to set the config_id for tuning -- cgit v1.2.1