diff options
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLDepthConvertLayer.h')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLDepthConvertLayer.h | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/arm_compute/runtime/CL/functions/CLDepthConvertLayer.h b/arm_compute/runtime/CL/functions/CLDepthConvertLayer.h index 910b9eac51..3e7ca8830b 100644 --- a/arm_compute/runtime/CL/functions/CLDepthConvertLayer.h +++ b/arm_compute/runtime/CL/functions/CLDepthConvertLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 ARM Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,31 +25,49 @@ #define ARM_COMPUTE_CLDEPTHCONVERT_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 run @ref CLDepthConvertLayerKernel. */ -class CLDepthConvertLayer : public ICLSimpleFunction +/** Basic function to run @ref opencl::kernels::ClCastKernel */ +class CLDepthConvertLayer : public IFunction { public: + /** Constructor */ + CLDepthConvertLayer(); + /** Destructor */ + ~CLDepthConvertLayer(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLDepthConvertLayer(const CLDepthConvertLayer &) = delete; + /** Default move constructor */ + CLDepthConvertLayer(CLDepthConvertLayer &&); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLDepthConvertLayer &operator=(const CLDepthConvertLayer &) = delete; + /** Default move assignment operator */ + CLDepthConvertLayer &operator=(CLDepthConvertLayer &&); /** Initialize the function's source, destination * - * Input data type must be different than output data type. + * Valid data layouts: + * - All * - * Valid conversions Input -> Output : + * Valid data type configurations: + * |src |dst | + * |:--------------|:-------------------------------------| + * |U8 | S8, U16, S16, U32, S32, F16, F32 | + * |U16 | U8, S8, S16, U32, S32, F16, F32 | + * |S16 | U8, S8, U16, U32, S32, F16, F32 | + * |U32 | U8, S8, U16, S16, S32, F16, F32 | + * |S32 | U8, S8, U16, S16, U32, F16, F32 | + * |F16 | U8, S8, U16, S16, U32, F32 | + * |F32 | U8, S8, U16, S16, U32, F16 | * - * - U8 -> S8, U16, S16, U32, S32, F16, F32 - * - U16 -> U8, S8, S16, U32, S32, F16, F32 - * - S16 -> U8, S8, U16, U32, S32, F16, F32 - * - U32 -> U8, S8, U16, S16, S32, F16, F32 - * - S32 -> U8, S8, U16, S16, U32, F16, F32 - * - F16 -> U8, S8, U16, S16, U32, F32 - * - F32 -> U8, S8, U16, S16, U32, F16 + * Input data type must be different than output data type. * * @param[in] input The input tensor to convert. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32. * @param[out] output The output tensor. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32. @@ -77,7 +95,11 @@ public: * @param[in] policy Conversion policy. * @param[in] shift Value for down/up conversions. Must be 0 <= shift < 8. */ - void configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, ConvertPolicy policy, uint32_t shift); + void configure(const CLCompileContext &compile_context, + const ICLTensor *input, + ICLTensor *output, + ConvertPolicy policy, + uint32_t shift); /** Static function to check if given info will lead to a valid configuration of @ref CLDepthConvertLayer * * @param[in] input Source tensor info. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32. @@ -88,6 +110,13 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, ConvertPolicy policy, uint32_t shift); + + // Inherited methods overridden: + void run() override; + +private: + struct Impl; + std::unique_ptr<Impl> _impl; }; } // namespace arm_compute #endif /*ARM_COMPUTE_CLDEPTHCONVERT_H*/ |