aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/functions/CLPermute.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLPermute.h')
-rw-r--r--arm_compute/runtime/CL/functions/CLPermute.h45
1 files changed, 39 insertions, 6 deletions
diff --git a/arm_compute/runtime/CL/functions/CLPermute.h b/arm_compute/runtime/CL/functions/CLPermute.h
index 37e651cfbb..7ac0bf6b9c 100644
--- a/arm_compute/runtime/CL/functions/CLPermute.h
+++ b/arm_compute/runtime/CL/functions/CLPermute.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 ARM Limited.
+ * Copyright (c) 2018-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -25,20 +25,43 @@
#define ARM_COMPUTE_CLPERMUTE_H
#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/ICLSimpleFunction.h"
+#include "arm_compute/runtime/IFunction.h"
-#include <cstdint>
+#include <memory>
namespace arm_compute
{
+class CLCompileContext;
class ICLTensor;
+class ITensorInfo;
-/** Basic function to execute an @ref CLPermuteKernel. */
-class CLPermute : public ICLSimpleFunction
+/** Basic function to execute an @ref opencl::kernels::ClPermuteKernel. */
+class CLPermute : public IFunction
{
public:
+ /** Constructor */
+ CLPermute();
+ /** Destructor */
+ ~CLPermute();
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLPermute(const CLPermute &) = delete;
+ /** Default move constructor */
+ CLPermute(CLPermute &&) = default;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLPermute &operator=(const CLPermute &) = delete;
+ /** Default move assignment operator */
+ CLPermute &operator=(CLPermute &&) = default;
/** Set the input and output tensors.
*
+ * Valid data layouts:
+ * - NHWC
+ * - NCHW
+ *
+ * Valid data type configurations:
+ * |src |dst |
+ * |:--------------|:--------------|
+ * |All |All |
+ *
* @note Arbitrary permutation vectors are supported with rank not greater than 4
*
* @param[in] input The input tensor to permute. Data types supported: All.
@@ -55,7 +78,10 @@ public:
* @param[in] output The output tensor. Data types supported: Same as @p input
* @param[in] perm Permutation vector
*/
- void configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, const PermutationVector &perm);
+ void configure(const CLCompileContext &compile_context,
+ const ICLTensor *input,
+ ICLTensor *output,
+ const PermutationVector &perm);
/** Static function to check if given info will lead to a valid configuration of @ref CLPermute.
*
* @note Arbitrary permutation vectors are supported with rank not greater than 4
@@ -67,6 +93,13 @@ public:
* @return a status
*/
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm);
+
+ // Inherited methods overridden:
+ void run() override;
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> _impl;
};
} // namespace arm_compute
#endif /*ARM_COMPUTE_CLPERMUTE_H */