Compute Library
 22.08
ClCast Class Reference

Basic function to run kernels::ClCastKernel. More...

#include <ClCast.h>

Collaboration diagram for ClCast:
[legend]

Public Member Functions

void configure (const ClCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst, ConvertPolicy policy)
 Configure operator for a given list of arguments. More...
 
- Public Member Functions inherited from ICLOperator
 ICLOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLOperator (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLOperator (ICLOperator &&)=default
 Default move constructor. More...
 
ICLOperatoroperator= (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLOperatoroperator= (ICLOperator &&)=default
 Default move assignment operator. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. More...
 
MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from IOperator
virtual ~IOperator ()=default
 Destructor. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src, const ITensorInfo *dst, ConvertPolicy policy)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to run kernels::ClCastKernel.

Definition at line 35 of file ClCast.h.

Member Function Documentation

◆ configure()

void configure ( const ClCompileContext compile_context,
const ITensorInfo src,
ITensorInfo dst,
ConvertPolicy  policy 
)

Configure operator for a given list of arguments.

Note
Input data type must be different than output data type.

Valid data layouts:

  • All

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
Parameters
[in]compile_contextThe compile context to be used.
[in]srcThe source tensor to convert. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32.
[out]dstThe destinatio tensor. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32.
[in]policyConversion policy.

Definition at line 35 of file ClCast.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

36 {
37  ARM_COMPUTE_LOG_PARAMS(src, dst, policy);
38  auto k = std::make_unique<kernels::ClCastKernel>();
39  k->configure(compile_context, src, dst, policy);
40  _kernel = std::move(k);
41 }
SimpleTensor< float > src
Definition: DFT.cpp:155
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst,
ConvertPolicy  policy 
)
static

Static function to check if given info will lead to a valid configuration.

Similar to ClCast::configure()

Returns
a status

Definition at line 43 of file ClCast.cpp.

References ClCastKernel::validate().

Referenced by CLCast::validate(), and CLDepthConvertLayer::validate().

44 {
45  return kernels::ClCastKernel::validate(src, dst, policy);
46 }
SimpleTensor< float > src
Definition: DFT.cpp:155
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, ConvertPolicy policy)
Static function to check if given info will lead to a valid configuration.

The documentation for this class was generated from the following files: