24.04
|
Go to the documentation of this file.
36 namespace experimental
38 namespace dynamic_fusion
42 Status is_supported_op_helper(
const GpuWorkloadContext &
context,
43 const ITensorInfo *
src,
44 const ITensorInfo *
dst,
45 const ReshapeAttributes &attributes)
49 TensorInfo dst_info_to_validate;
50 const ITensorInfo *dst_info_to_validate_ptr = &dst_info_to_validate;
54 dst_info_to_validate_ptr =
dst;
62 const auto cl_compile_ctx =
context.cl_compile_context();
66 ArgumentPack<ITensorInfo> arguments;
68 arguments.add_const_tensor(
ACL_DST_0, dst_info_to_validate_ptr);
86 return is_supported_op_helper(
context,
src,
nullptr, attributes);
107 "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.
ITensorInfo * create_virtual_tensor()
Create a virtual (see MemoryType) tensor info and save it.
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.
static Status validate(const ArgumentPack< ITensorInfo > &tensors)
Validate the component.
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_ON_ERROR(status)
Checks if a status contains an error and returns it.
@ RUNTIME_ERROR
Generic runtime error.
#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.
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 Status is_supported_op(const GpuWorkloadContext &context, const ITensorInfo *src, const Attributes &attributes)
Check if the operator configuration is supported, irrespective of fusion.
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.
Describes when a unit workload is run.
GpuOperatorType
Contain properties common to all operator types.
Store the tensor's metadata.
ReshapeAttributes & shape(const TensorShape &shape)
Set destination shape to reshape to.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
Attributes are backend-agnostic parameters (in addition to the input/output tensors) of an operator.
#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.
void add_operator(const Operator &op, bool is_output=false)
Add an operator to the group.
static Status validate_op(const GpuWorkloadSketch &sketch, const ITensorInfo *src, const Attributes &attributes)
Validate the operator and check if the its configuration is supported and if it can be fused into the...
#define ARM_COMPUTE_LOG_PARAMS(...)
static ITensorInfo * create_op(GpuWorkloadSketch &sketch, ITensorInfo *src, const Attributes &attributes)
Create an operator and fuse it into the workload sketch.