24.02.1
|
Go to the documentation of this file.
45 namespace experimental
47 namespace dynamic_fusion
51 void calculate_and_init_dst_if_empty(ITensorInfo *
dst,
52 const ITensorInfo *
src,
53 const Pool2dAttributes &attributes,
54 const GpuPool2dSettings &settings)
58 if (
dst->total_size() == 0U)
77 return _use_inf_as_limit;
91 calculate_and_init_dst_if_empty(&dst_info_to_validate,
src, attributes, settings);
101 "Operator fusion test failed. This operator cannot be fused into the workload");
119 "Exclude padding must be set to true in Attributes!");
124 calculate_and_init_dst_if_empty(&dst_info_to_validate,
src, attributes, settings);
129 const auto cl_compile_ctx =
context.cl_compile_context();
163 calculate_and_init_dst_if_empty(
dst,
src, attributes, settings);
184 comp_graph.add_new_component<
ClComponentPool2d>(properties, arguments, attributes, settings);
bool use_inf_as_limit() const
Operator backend specific settings.
static Status validate_op(const GpuWorkloadSketch &sketch, const ITensorInfo *src, const Attributes &attributes, const Settings &settings)
Validate the operator and check if it can be fused into the workload sketch.
Operator new_operator(const GpuOperatorType &operator_type, const ArgumentPack< ITensorInfo > &tensors) const
Create a new operator.
SimpleTensor< float > src
@ Run
Run every time after the first time.
@ NHWC
Num samples, height, width, channels.
TensorShape compute_pool_shape(const ITensorInfo &input, PoolingLayerInfo pool_info)
Calculate the output pool shape of a tensor.
ITensorInfo * create_virtual_tensor()
Create a virtual (see MemoryType) tensor info and save it.
static Status is_supported_op(const GpuWorkloadContext &context, const ITensorInfo *src, const Attributes &attributes, const Settings &settings)
Check if the operator configuration is supported, irrespective of fusion.
const GpuOperatorGroup & operator_group() const
Get operator group.
bool try_add_operator(const Operator &op, bool is_output=false) const
Try adding (without actually adding) an operator to the group.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
This is a generic class that packs the arguments of an operator.
const GpuWorkloadContext * gpu_context() const
Get the gpu workload context of this sketch.
Implementation & implementation()
Get the implementation.
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
PoolingLayerInfo convert_pool_attr_to_pool_info(const Pool2dAttributes &pool_attr, bool mixed_precision=false, DataLayout data_layout=DataLayout::NHWC)
Inline function to convert Pool2dAttributes to PoolingLayerInfo.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
@ Complex
Complex operators are operators that are not simple but are still fusable with simple ones.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
const GpuKernelComponentGraph & component_graph() const
Get component graph.
Properties common to all kernel component types.
A descriptor of a workload of operators.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
Provide context necessary for the creation and configuration of a workload e.g.
void add_const_tensor(Id id, const T *tensor)
Add const tensor to the pack.
const CLCompileContext * cl_compile_context() const
Get CLCompileContext If the gpu language is not OpenCL, then return nullptr.
static ITensorInfo * create_op(GpuWorkloadSketch &sketch, ITensorInfo *src, const Attributes &attributes, const Settings &settings)
Create an operator and fuse it into the workload sketch.
const Context * context() const
Get workload context.
void add_tensor(Id id, T *tensor)
Add tensor to the pack.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
bool exclude_padding() const
Attributes are backend-agnostic parameters (in addition to the input/output tensors) of an operator.
KernelProperties & stage(const UnitWorkloadStage &stage)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN(t,...)
Describes when a unit workload is run.
GpuOperatorType
Contain properties common to all operator types.
Store the tensor's metadata.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
KernelProperties Properties
Store the tensor's metadata.
#define ARM_COMPUTE_RETURN_ERROR_MSG(...)
An error is returned with the given description.
@ F32
32-bit floating-point number
void add_operator(const Operator &op, bool is_output=false)
Add an operator to the group.
static Status validate(const Properties &properties, const ArgumentPack< ITensorInfo > &tensors, const Attributes &attributes, const Settings &settings)
Validate the component.
#define ARM_COMPUTE_LOG_PARAMS(...)