aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/functions/CLFill.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLFill.h')
-rw-r--r--arm_compute/runtime/CL/functions/CLFill.h57
1 files changed, 44 insertions, 13 deletions
diff --git a/arm_compute/runtime/CL/functions/CLFill.h b/arm_compute/runtime/CL/functions/CLFill.h
index fef8324432..9a27d158a6 100644
--- a/arm_compute/runtime/CL/functions/CLFill.h
+++ b/arm_compute/runtime/CL/functions/CLFill.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited.
+ * Copyright (c) 2019-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,32 +24,63 @@
#ifndef ARM_COMPUTE_CLFILL_H
#define ARM_COMPUTE_CLFILL_H
-#include "arm_compute/core/PixelValue.h"
#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/ICLSimpleFunction.h"
+#include "arm_compute/core/Window.h"
+#include "arm_compute/runtime/IFunction.h"
+#include <memory>
namespace arm_compute
{
class CLCompileContext;
class ICLTensor;
-/** Function to run @ref CLMemsetKernel to fill a tensor with a scalar value */
-class CLFill : public ICLSimpleFunction
+/** Basic function to run @ref opencl::kernels::ClFillKernel */
+class CLFill : public IFunction
{
public:
- /** Initialize the function
+ /** Constructor */
+ CLFill();
+ /** Destructor */
+ ~CLFill();
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLFill(const CLFill &) = delete;
+ /** Default move constructor */
+ CLFill(CLFill &&);
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLFill &operator=(const CLFill &) = delete;
+ /** Default move assignment operator */
+ CLFill &operator=(CLFill &&);
+ /** Initialize the kernel's tensor and filling value
*
- * @param[in,out] tensor Source tensor. Data types supported: All.
- * @param[in] constant_value Constant value to use to fill tensor.
+ * @param[in,out] tensor Input tensor to fill. Supported data types: All.
+ * @param[in] constant_value The value used to fill the planes of the tensor
+ * @param[in] window Window to be used in case setting only part of a tensor. Default is nullptr.
*/
- void configure(ICLTensor *tensor, PixelValue constant_value);
- /** Initialize the function
+ void configure(ICLTensor *tensor, const PixelValue &constant_value, Window *window = nullptr);
+ /** Initialise the kernel's tensor and filling value
*
* @param[in] compile_context The compile context to be used.
- * @param[in,out] tensor Source tensor. Data types supported: All.
- * @param[in] constant_value Constant value to use to fill tensor.
+ * @param[in,out] tensor Input tensor to fill. Supported data types: All.
+ * @param[in] constant_value The value used to fill the planes of the tensor
+ * @param[in] window Window to be used in case setting only part of a tensor. Default is nullptr.
*/
- void configure(const CLCompileContext &compile_context, ICLTensor *tensor, PixelValue constant_value);
+ void configure(const CLCompileContext &compile_context, ICLTensor *tensor, const PixelValue &constant_value, Window *window = nullptr);
+ /** Static function to check if given info will lead to a valid configuration of @ref CLFill
+ *
+ * @param[in] tensor Source tensor info. Data types supported: All.
+ * @param[in] constant_value The value used to fill the planes of the tensor
+ * @param[in] window Window to be used in case setting only part of a tensor. Default is nullptr.
+ *
+ * @return a status
+ */
+ static Status validate(const ITensorInfo *tensor, const PixelValue &constant_value, Window *window = nullptr);
+
+ // Inherited methods overridden:
+ void run() override;
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> _impl;
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_CLFILL_H */