Compute Library
 22.11
ElementwiseContent Class Reference

#include <OperatorGraphImpl.h>

Collaboration diagram for ElementwiseContent:
[legend]

Public Member Functions

 ElementwiseContent ()=default
 
 ElementwiseContent (const OperatorGraph::Implementation *graph, Id id, const ElementwiseDescriptor &desc, const ITensorDescPack< OpTensorContent > &tensors)
 
 ~ElementwiseContent ()=default
 
 ElementwiseContent (const ElementwiseContent &)=default
 
ElementwiseContentoperator= (const ElementwiseContent &)=default
 
 ElementwiseContent (ElementwiseContent &&)=default
 
ElementwiseContentoperator= (ElementwiseContent &&)=default
 
bool operator== (const OperatorContent &other) const override
 
OperatorComplexity complexity () const override
 
Status translate (ClKernelGraph &kernel_graph) const override
 
- Public Member Functions inherited from OperatorContent
 OperatorContent ()=default
 
 OperatorContent (const OperatorGraph::Implementation *graph, Id id, const ITensorDescPack< OpTensorContent > &tensors)
 
 OperatorContent (const OperatorContent &op)=default
 
OperatorContentoperator= (const OperatorContent &op)=default
 
 OperatorContent (OperatorContent &&op)=default
 
OperatorContentoperator= (OperatorContent &&op)=default
 
virtual ~OperatorContent ()=default
 

Additional Inherited Members

- Public Types inherited from OperatorContent
using Id = DependencyGraph::Id
 

Detailed Description

Definition at line 160 of file OperatorGraphImpl.h.

Constructor & Destructor Documentation

◆ ElementwiseContent() [1/4]

ElementwiseContent ( )
default

◆ ElementwiseContent() [2/4]

ElementwiseContent ( const OperatorGraph::Implementation graph,
Id  id,
const ElementwiseDescriptor desc,
const ITensorDescPack< OpTensorContent > &  tensors 
)
inline

Definition at line 164 of file OperatorGraphImpl.h.

References arm_compute::experimental::dynamic_fusion::operator==().

165  : OperatorContent(graph, id, tensors), desc(desc)
166  {
167  }

◆ ~ElementwiseContent()

~ElementwiseContent ( )
default

◆ ElementwiseContent() [3/4]

ElementwiseContent ( const ElementwiseContent )
default

◆ ElementwiseContent() [4/4]

Member Function Documentation

◆ complexity()

◆ operator=() [1/2]

ElementwiseContent& operator= ( const ElementwiseContent )
default

◆ operator=() [2/2]

ElementwiseContent& operator= ( ElementwiseContent &&  )
default

◆ operator==()

bool operator== ( const OperatorContent other) const
overridevirtual

Implements OperatorContent.

Definition at line 128 of file OperatorGraphImpl.cpp.

References Conv2dContent::desc.

129 {
130  const auto converted = *utils::cast::polymorphic_downcast<const ElementwiseContent *>(&other);
131  return desc == converted.desc;
132 }

◆ translate()

Status translate ( ClKernelGraph kernel_graph) const
overridevirtual

Implements OperatorContent.

Definition at line 321 of file OperatorGraphImpl.cpp.

References arm_compute::ACL_DST_0, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, ITensorDescPack< TDesc >::add_const_tensor(), ClKernelGraph::add_kernel(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, ARM_COMPUTE_UNUSED, Conv2dContent::desc, arm_compute::test::validation::dst, ClKernelGraph::get_tensor(), UnitWorkloadStage::Run, arm_compute::experimental::dynamic_fusion::TStoreIndirectWidthSelect, and ClElementwiseKernel::validate().

322 {
323  const auto lhs = _tensors.get_const_tensor(TensorType::ACL_SRC_0);
324  const auto rhs = _tensors.get_const_tensor(TensorType::ACL_SRC_1);
325  const auto dst = _tensors.get_const_tensor(TensorType::ACL_DST_0);
327 
328  ITensorDescPack<ClKernelTensor> tensors;
329 
330  DependencyGraph::Id lhs_id;
331  auto st = add_kernel_tensor(kernel_graph, *_graph, *lhs, lhs_id);
333  tensors.add_const_tensor(ACL_SRC_0, kernel_graph.get_tensor(lhs_id));
334 
335  DependencyGraph::Id rhs_id;
336  st = add_kernel_tensor(kernel_graph, *_graph, *rhs, rhs_id);
338  tensors.add_const_tensor(ACL_SRC_1, kernel_graph.get_tensor(rhs_id));
339 
340  DependencyGraph::Id dst_id;
341  st = add_kernel_tensor(kernel_graph, *_graph, *dst, dst_id);
343  tensors.add_const_tensor(ACL_DST_0, kernel_graph.get_tensor(dst_id));
344 
345  DependencyGraph::Id add_id;
346  ClKernelConfig config{ UnitWorkloadStage{ UnitWorkloadStage::Stage::Run }, TileDescriptor{}, StoreType::TStoreIndirectWidthSelect };
347 
348  st = ClElementwiseKernel::validate(lhs->desc, rhs->desc, dst->desc);
350 
351  st = kernel_graph.add_kernel<ClElementwiseKernel>(config, ClElementwiseKernelDescriptor{ desc }, tensors, add_id);
353  ARM_COMPUTE_UNUSED(add_id);
354 
355  return Status{};
356 }
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
static Status validate(const ITensorInfo *lhs, const ITensorInfo *rhs, const ITensorInfo *dst)
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:157

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