aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLRemapKernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/kernels/CLRemapKernel.h')
-rw-r--r--src/core/CL/kernels/CLRemapKernel.h47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/core/CL/kernels/CLRemapKernel.h b/src/core/CL/kernels/CLRemapKernel.h
index 8efcf091ed..1e3a4ad13f 100644
--- a/src/core/CL/kernels/CLRemapKernel.h
+++ b/src/core/CL/kernels/CLRemapKernel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,6 +24,7 @@
#ifndef ARM_COMPUTE_CLREMAPKERNEL_H
#define ARM_COMPUTE_CLREMAPKERNEL_H
+#include "arm_compute/core/KernelDescriptors.h"
#include "arm_compute/core/Types.h"
#include "src/core/CL/ICLKernel.h"
@@ -47,25 +48,36 @@ public:
CLRemapKernel &operator=(CLRemapKernel &&) = default;
/** Initialize the kernel's input, output and border mode.
*
- * @param[in] input Source tensor. Data types supported: U8.
- * @param[in] map_x Map for X coordinates. Data types supported: F32.
- * @param[in] map_y Map for Y coordinates. Data types supported: F32.
- * @param[out] output Destination tensor. Data types supported: U8. All but the lowest two dimensions must be the same size as in the input tensor, i.e. remapping is only performed within the XY-plane.
- * @param[in] policy The interpolation type.
- * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
+ * @param[in] compile_context The compile context to be used.
+ * @param[in] input Source tensor. Data types supported: U8.
+ * @param[in] map_x Map for X coordinates. Data types supported: F32.
+ * @param[in] map_y Map for Y coordinates. Data types supported: F32.
+ * @param[out] output Destination tensor. Data types supported: U8. All but the lowest two dimensions must be the same size as in the input tensor, i.e. remapping is only performed within the XY-plane.
+ * @param[in] info RemapInfo struct:
+ * - policy Interpolation policy to use. Only NEAREST and BILINEAR are supported.
+ * - border_mode Border mode to use on the input tensor. Only CONSTANT and UNDEFINED are supported.
+ * - constant_border_value Constant value to use for borders if border_mode is set to CONSTANT.
*/
- void configure(const ICLTensor *input, const ICLTensor *map_x, const ICLTensor *map_y, ICLTensor *output, InterpolationPolicy policy, bool border_undefined);
- /** Initialize the kernel's input, output and border mode.
+ void configure(const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *map_x, const ICLTensor *map_y, ICLTensor *output, RemapInfo info);
+ /** Validate the kernel's input, output and border mode.
+ *
+ * @param[in] input Source tensor. Data types supported: U8.
+ * @param[in] map_x Map for X coordinates. Data types supported: F32.
+ * @param[in] map_y Map for Y coordinates. Data types supported: F32.
+ * @param[out] output Destination tensor. Data types supported: U8. All but the lowest two dimensions must be the same size as in the input tensor, i.e. remapping is only performed within the XY-plane.
+ * @param[in] info RemapInfo struct:
+ * - policy Interpolation policy to use. Only NEAREST and BILINEAR are supported.
+ * - border_mode Border mode to use on the input tensor. Only CONSTANT and UNDEFINED are supported.
+ * - constant_border_value Constant value to use for borders if border_mode is set to CONSTANT.
+ */
+ static Status validate(const ITensorInfo *input, const ITensorInfo *map_x, const ITensorInfo *map_y, ITensorInfo *output, RemapInfo info);
+ /** Function to set the constant value on fill border kernel depending on type.
*
- * @param[in] compile_context The compile context to be used.
- * @param[in] input Source tensor. Data types supported: U8.
- * @param[in] map_x Map for X coordinates. Data types supported: F32.
- * @param[in] map_y Map for Y coordinates. Data types supported: F32.
- * @param[out] output Destination tensor. Data types supported: U8. All but the lowest two dimensions must be the same size as in the input tensor, i.e. remapping is only performed within the XY-plane.
- * @param[in] policy The interpolation type.
- * @param[in] border_undefined True if the border mode is undefined. False if it's replicate or constant.
+ * @param[in] idx Index of the kernel argument to set.
+ * @param[in] constant_border_value Constant value to use for borders if border_mode is set to CONSTANT.
*/
- void configure(const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *map_x, const ICLTensor *map_y, ICLTensor *output, InterpolationPolicy policy, bool border_undefined);
+ template <class T>
+ void set_constant_border(unsigned int idx, const PixelValue &constant_border_value);
// Inherited methods overridden:
void run(const Window &window, cl::CommandQueue &queue) override;
@@ -76,6 +88,7 @@ private:
ICLTensor *_output;
const ICLTensor *_map_x;
const ICLTensor *_map_y;
+ DataLayout _data_layout;
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_CLREMAPKERNEL_H */