aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/NEON/functions/NEScale.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/runtime/NEON/functions/NEScale.h')
-rw-r--r--arm_compute/runtime/NEON/functions/NEScale.h56
1 files changed, 42 insertions, 14 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEScale.h b/arm_compute/runtime/NEON/functions/NEScale.h
index fceda83510..72dfa3bda4 100644
--- a/arm_compute/runtime/NEON/functions/NEScale.h
+++ b/arm_compute/runtime/NEON/functions/NEScale.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2020 Arm Limited.
+ * Copyright (c) 2016-2022 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -26,32 +26,58 @@
#include "arm_compute/core/KernelDescriptors.h"
#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/NEON/INESimpleFunctionNoBorder.h"
-#include "arm_compute/runtime/Tensor.h"
+#include "arm_compute/runtime/IFunction.h"
+
+#include <memory>
namespace arm_compute
{
class ITensor;
+class ITensorInfo;
-/** Basic function to run @ref NEScaleKernel */
-class NEScale : public INESimpleFunctionNoBorder
+/** Basic function to compute Scale */
+class NEScale : public IFunction
{
public:
- /** Constructor
- *
- * Initialize NEScale
- */
+ /** Constructor */
NEScale();
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEScale(const NEScale &) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEScale(NEScale &&) = delete;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEScale &operator=(const NEScale &) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEScale &operator=(NEScale &&) = delete;
+ /** Destructor */
+ ~NEScale();
/** Initialize the function's source, destination, interpolation type and border_mode.
*
- * @param[in, out] input Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/U8/S16/F16/F32. (Written to only for @p border_mode != UNDEFINED)
+ * Valid data layouts:
+ * - NHWC
+ * - NCHW
+ *
+ * Valid data type configurations:
+ * |src |dst |
+ * |:--------------|:--------------|
+ * |QASYMM8 |QASYMM8 |
+ * |QASYMM8_SIGNED |QASYMM8_SIGNED |
+ * |F16 |F16 |
+ * |F32 |F32 |
+ * |U8 |U8 |
+ * |S8 |S8 |
+ * |S16 |S16 |
+ *
+ * @param[in, out] input Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/U8/S8/S16/F16/F32. (Written to only for @p border_mode != UNDEFINED)
* @param[out] output Destination tensor. Data type supported: Same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
* @param[in] info @ref ScaleKernelInfo to be used for configuration
+ *
+ * @note Using S8 data type only supports NHWC, @p border_mode Replicate, and @p policy Bilinear
*/
void configure(ITensor *input, ITensor *output, const ScaleKernelInfo &info);
/** Static function to check if given info will lead to a valid configuration of @ref NEScale
*
- * @param[in] input Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/U8/S16/F16/F32. (Written to only for @p border_mode != UNDEFINED)
+ * @param[in] input Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/U8/S8/S16/F16/F32. (Written to only for @p border_mode != UNDEFINED)
* @param[in] output Destination tensor. Data type supported: Same as @p input. All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane.
* @param[in] info @ref ScaleKernelInfo to be used for validation
*
@@ -59,10 +85,12 @@ public:
*/
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ScaleKernelInfo &info);
+ // Inherited methods overridden:
+ void run() override;
+
private:
- Tensor _offsets; /**< Offset to access the element with NEAREST interpolation or the top-left element with BILINEAR interpolation in the input tensor */
- Tensor _dx; /**< Element's distance between the X real coordinate and the smallest X following integer */
- Tensor _dy; /**< Element's distance between the Y real coordinate and the smallest Y following integer */
+ struct Impl;
+ std::unique_ptr<Impl> _impl;
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_NESCALEIMAGE_H */