Compute Library
 21.11
ClMul Class Reference

Basic function to run opencl::kernels::ClMulKernel. More...

#include <ClMul.h>

Collaboration diagram for ClMul:
[legend]

Public Member Functions

void configure (const CLCompileContext &compile_context, ITensorInfo *src1, ITensorInfo *src2, ITensorInfo *dst, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Initialise the kernel's sources, dst and convertion policy. 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 *src1, const ITensorInfo *src2, const ITensorInfo *dst, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to run opencl::kernels::ClMulKernel.

Definition at line 35 of file ClMul.h.

Member Function Documentation

◆ configure()

void configure ( const CLCompileContext compile_context,
ITensorInfo src1,
ITensorInfo src2,
ITensorInfo dst,
float  scale,
ConvertPolicy  overflow_policy,
RoundingPolicy  rounding_policy,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)

Initialise the kernel's sources, dst and convertion policy.

Valid configurations (src1,src2) -> Output :

  • (U8,U8) -> U8
  • (U8,U8) -> S16
  • (U8,S16) -> S16
  • (S16,U8) -> S16
  • (S16,S16) -> S16
  • (F16,F16) -> F16
  • (F32,F32) -> F32
  • (QASYMM8,QASYMM8) -> QASYMM8
  • (QASYMM8_SIGNED,QASYMM8_SIGNED) -> QASYMM8_SIGNED
  • (QSYMM16,QSYMM16) -> QSYMM16
  • (QSYMM16,QSYMM16) -> S32
Parameters
[in]compile_contextThe compile context to be used.
[in,out]src1An src tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/F32. The src tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[in,out]src2An src tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/F32. The src tensor is [in, out] because its TensorInfo might be modified inside the kernel in case of broadcasting of dimension 0.
[out]dstThe dst tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/F32.
[in]scaleScale to apply after multiplication. Scale must be positive and its value must be either 1/255 or 1/2^n where n is between 0 and 15.
[in]overflow_policyOverflow policy. Supported overflow policies: Wrap, Saturate
[in]rounding_policyRounding policy. Supported rounding modes: to zero, to nearest even.
[in]act_info(Optional) Activation layer information in case of a fused activation.

Definition at line 36 of file ClMul.cpp.

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

38 {
39  ARM_COMPUTE_LOG_PARAMS(src1, src2, dst, scale, overflow_policy, rounding_policy, act_info);
40  auto k = std::make_unique<kernels::ClMulKernel>();
41  k->configure(compile_context, src1, src2, dst, scale, overflow_policy, rounding_policy, act_info);
42  _kernel = std::move(k);
43 }
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo src1,
const ITensorInfo src2,
const ITensorInfo dst,
float  scale,
ConvertPolicy  overflow_policy,
RoundingPolicy  rounding_policy,
const ActivationLayerInfo act_info = ActivationLayerInfo() 
)
static

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

Similar to ClMul::configure()

Returns
a status

Definition at line 45 of file ClMul.cpp.

References ClMulKernel::validate().

Referenced by CLPixelWiseMultiplication::validate().

47 {
48  return kernels::ClMulKernel::validate(src1, src2, dst, scale, overflow_policy, rounding_policy, act_info);
49 }
static Status validate(const ITensorInfo *src1, const ITensorInfo *src2, const ITensorInfo *dst, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration.

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