24.02.1
|
Go to the documentation of this file.
37 namespace experimental
39 namespace dynamic_fusion
43 Status is_supported_op_helper(
const GpuWorkloadContext &
context,
44 const ITensorInfo *
src,
45 const ITensorInfo *
dst,
46 const ClampAttributes &attributes)
51 "Maximum clamp value cannot be lower than minimum value");
53 TensorInfo dst_info_to_validate;
54 const ITensorInfo *dst_info_to_validate_ptr = &dst_info_to_validate;
58 dst_info_to_validate_ptr =
dst;
65 attributes.max_val(), attributes.min_val()};
71 const auto properties =
74 ArgumentPack<ITensorInfo> arguments;
76 arguments.add_const_tensor(
ACL_DST, dst_info_to_validate_ptr);
92 return is_supported_op_helper(
context,
src,
nullptr, attributes);
114 "Operator fusion test failed. This operator cannot be fused into the workload");
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.
@ Simple
Simple operators are operators that:
ITensorInfo * create_virtual_tensor()
Create a virtual (see MemoryType) tensor info and save it.
static Status validate_op(const GpuWorkloadSketch &sketch, const ITensorInfo *src, const Attributes &attributes)
Validate the operator and check if it can be fused into the workload sketch.
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.
ActivationLayerInfo Attributes
Attributes are a set of backend-agnostic parameters that define what a component does.
A multi-input (tensors), multi-output (tensors) acyclic directed graph of gpu kernel components Its m...
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,...)
ClampAttributes & max_val(const float &max_val)
Set the maximum clip value.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Activation Layer Information class.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
#define ARM_COMPUTE_ERROR_THROW_ON(status)
const GpuKernelComponentGraph & component_graph() const
Get component graph.
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 Context * context() const
Get workload context.
static ITensorInfo * create_op(GpuWorkloadSketch &sketch, ITensorInfo *src, const Attributes &attributes)
Create an operator and fuse it into the workload sketch.
KernelProperties & stage(const UnitWorkloadStage &stage)
Describes when a unit workload is run.
GpuOperatorType
Contain properties common to all operator types.
Store the tensor's metadata.
void add_new_component(Args &&...args)
Create a new component and add it to the component graph Component id is automatically allocated.
Attributes are backend-agnostic parameters (in addition to the input/output tensors) of an operator.
#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
ClampAttributes & min_val(const float &min_val)
Set the minimum clip value.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
KernelProperties Properties
static Status is_supported_op(const GpuWorkloadContext &context, const ITensorInfo *src, const Attributes &attributes)
Check if the operator configuration is supported, irrespective of fusion.
Store the tensor's metadata.
#define ARM_COMPUTE_RETURN_ERROR_MSG(...)
An error is returned with the given description.
static Status validate(const Properties &properties, const ArgumentPack< ITensorInfo > &tensors, const Attributes &attributes)
Validate the component.
@ F32
32-bit floating-point number
void add_operator(const Operator &op, bool is_output=false)
Add an operator to the group.
#define ARM_COMPUTE_LOG_PARAMS(...)