24.02.1
|
A group of gpu kernel components to be fused together PRECONDITIONS: More...
#include <GpuKernelComponentGroup.h>
Public Types | |
using | ComponentPtr = IGpuKernelComponent * |
Public Member Functions | |
GpuKernelComponentGroup ()=default | |
Default constructor. More... | |
GpuKernelComponentGroup (const GpuKernelComponentGroup &)=default | |
Allow instances of this class to be copy constructed. More... | |
GpuKernelComponentGroup & | operator= (const GpuKernelComponentGroup &)=default |
Allow instances of this class to be copied. More... | |
GpuKernelComponentGroup (GpuKernelComponentGroup &&)=default | |
Allow instances of this class to be move constructed. More... | |
GpuKernelComponentGroup & | operator= (GpuKernelComponentGroup &&)=default |
Allow instances of this class to be moved. More... | |
bool | add_component (ComponentPtr component) |
Add a component pointer into the group If the operation fails, then no change is made to the group. More... | |
void | finalize () |
Optimize and pre-compute information about the component group. More... | |
const ITensorInfo * | get_any_dst_tensor () const |
Get one of the destination tensors of this group. More... | |
std::vector< const ITensorInfo * > | get_argument_tensors () const |
Get tensor argument of this group A tensor is an argument if it is a source or destination tensor to the group. More... | |
ComponentPtr | get_root_component () const |
Get the root (first) component of this group. More... | |
bool | is_intermediate_tensor (const ITensorInfo *tensor) const |
Check if a ITensorInfo is an "intermediate" tensor of the group. More... | |
bool | is_input_tensor (const ITensorInfo *tensor) const |
Check if an ITensorInfo is an input tensor of the group. More... | |
std::vector< const ITensorInfo * > | get_tiles () const |
Get the list of temporary tiles that need to be declared. More... | |
const ITensorInfo * | get_tile_for_tensor (const ITensorInfo *tensor) const |
Get the shared tile that can be used to store temporary data of the specified tensor. More... | |
size_t | size () const |
Get the number of components within the group. More... | |
bool | empty () const |
Check if the component group is empty. More... | |
ComponentPtr & | operator[] (size_t index) |
const ComponentPtr & | operator[] (size_t index) const |
std::vector< ComponentPtr >::iterator | begin () |
std::vector< ComponentPtr >::iterator | end () |
std::vector< ComponentPtr >::const_iterator | begin () const |
std::vector< ComponentPtr >::const_iterator | end () const |
std::vector< ComponentPtr >::const_iterator | cbegin () const |
std::vector< ComponentPtr >::const_iterator | cend () const |
Static Public Attributes | |
static constexpr size_t | max_fused_components = 64 |
Maximum number of components that can be fused into the same component group. More... | |
static constexpr size_t | max_dst_tensors = 8 |
Maximum number of dst tensors allowed for a component / component. More... | |
A group of gpu kernel components to be fused together PRECONDITIONS:
Definition at line 61 of file GpuKernelComponentGroup.h.
using ComponentPtr = IGpuKernelComponent * |
Definition at line 64 of file GpuKernelComponentGroup.h.
|
default |
Default constructor.
|
default |
Allow instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
bool add_component | ( | ComponentPtr | component | ) |
Add a component pointer into the group If the operation fails, then no change is made to the group.
[in] | component | Pointer to the component to be added |
Definition at line 39 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_MSG, GpuKernelComponentGroup::get_root_component(), arm_compute::detail::have_different_dimensions(), GpuKernelComponentGroup::max_dst_tensors, GpuKernelComponentGroup::max_fused_components, arm_compute::experimental::dynamic_fusion::Output, IGpuKernelComponent::properties(), arm_compute::experimental::dynamic_fusion::Simple, tf_frozen_model_extractor::t, IGpuKernelComponent::tensors(), IGpuKernelComponent::type(), type, arm_compute::utils::cast::U, and arm_compute::experimental::dynamic_fusion::Unfusable.
std::vector< GpuKernelComponentGroup::ComponentPtr >::const_iterator begin | ( | ) |
Definition at line 341 of file GpuKernelComponentGroup.cpp.
std::vector<ComponentPtr>::const_iterator begin | ( | ) | const |
std::vector< GpuKernelComponentGroup::ComponentPtr >::const_iterator cbegin | ( | ) | const |
Definition at line 357 of file GpuKernelComponentGroup.cpp.
std::vector< GpuKernelComponentGroup::ComponentPtr >::const_iterator cend | ( | ) | const |
Definition at line 361 of file GpuKernelComponentGroup.cpp.
bool empty | ( | ) | const |
Check if the component group is empty.
Definition at line 329 of file GpuKernelComponentGroup.cpp.
Referenced by GpuKernelComponentGroup::get_root_component().
std::vector< GpuKernelComponentGroup::ComponentPtr >::const_iterator end | ( | ) |
Definition at line 345 of file GpuKernelComponentGroup.cpp.
std::vector<ComponentPtr>::const_iterator end | ( | ) | const |
void finalize | ( | ) |
Optimize and pre-compute information about the component group.
Definition at line 129 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::dst_shape, arm_compute::experimental::dynamic_fusion::Output, arm_compute::experimental::dynamic_fusion::Simple, and tensor.
const ITensorInfo * get_any_dst_tensor | ( | ) | const |
Get one of the destination tensors of this group.
Definition at line 292 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG.
Referenced by ClTemplateCast::get_tag_lut(), ClTemplateReshape::get_tag_lut(), ClTemplateDepthwiseConv2d::get_tag_lut(), ClTemplateDirectConv2d::get_tag_lut(), ClTemplateResize::get_tag_lut(), and ClTemplateActivation::get_tag_lut().
std::vector< const ITensorInfo * > get_argument_tensors | ( | ) | const |
Get tensor argument of this group A tensor is an argument if it is a source or destination tensor to the group.
Definition at line 298 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG.
Referenced by ClTemplateWriter::get_tensors().
GpuKernelComponentGroup::ComponentPtr get_root_component | ( | ) | const |
Get the root (first) component of this group.
Definition at line 304 of file GpuKernelComponentGroup.cpp.
References GpuKernelComponentGroup::empty().
Referenced by GpuKernelComponentGroup::add_component(), ClTemplateCast::get_build_options(), ClTemplateLogits1DNorm::get_build_options(), ClTemplateReshape::get_build_options(), ClTemplateDirectConv2d::get_build_options(), ClTemplateResize::get_build_options(), ClTemplatePool2d::get_build_options(), ClTemplateActivation::get_build_options(), ClTemplateCast::get_component_code(), ClTemplateElementwiseBinary::get_component_code(), ClTemplateActivation::get_component_code(), ClTemplateCast::get_tag_lut(), ClTemplateWriter::get_window(), GpuCkwCast::write_component_code(), GpuCkwElementwiseBinary::write_component_code(), GpuCkwActivation::write_component_code(), GpuCkwPool2d::write_component_code(), GpuCkwDepthwiseConv2d::write_component_code(), GpuCkwDirectConv2d::write_component_code(), and GpuCkwMatMul::write_component_code().
const ITensorInfo * get_tile_for_tensor | ( | const ITensorInfo * | tensor | ) | const |
Get the shared tile that can be used to store temporary data of the specified tensor.
[in] | tensor | ITensorInfo to be looked up. |
tensor
. Definition at line 280 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, and tensor.
Referenced by GpuKernelVariableTable::declare_variable().
std::vector< const ITensorInfo * > get_tiles | ( | ) | const |
Get the list of temporary tiles that need to be declared.
Definition at line 274 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG.
bool is_input_tensor | ( | const ITensorInfo * | tensor | ) | const |
Check if an ITensorInfo is an input tensor of the group.
[in] | tensor | ITensorInfo to be looked up. |
tensor
is an input tensor of the group, otherwise false. Definition at line 319 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, and tensor.
Referenced by ClTemplateElementwiseBinary::get_component_code().
bool is_intermediate_tensor | ( | const ITensorInfo * | tensor | ) | const |
Check if a ITensorInfo is an "intermediate" tensor of the group.
An intermediate tensor is any tensor that is not an argument.
[in] | tensor | ITensorInfo to be looked up |
tensor
is an intermediate tensor Definition at line 313 of file GpuKernelComponentGroup.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, and tensor.
Referenced by GpuCkwVariableTable::declare_variable().
|
default |
Allow instances of this class to be copied.
|
default |
Allow instances of this class to be moved.
GpuKernelComponentGroup::ComponentPtr & operator[] | ( | size_t | index | ) |
Definition at line 333 of file GpuKernelComponentGroup.cpp.
const GpuKernelComponentGroup::ComponentPtr & operator[] | ( | size_t | index | ) | const |
Definition at line 337 of file GpuKernelComponentGroup.cpp.
size_t size | ( | ) | const |
Get the number of components within the group.
Definition at line 325 of file GpuKernelComponentGroup.cpp.
|
staticconstexpr |
Maximum number of dst tensors allowed for a component / component.
Definition at line 70 of file GpuKernelComponentGroup.h.
Referenced by GpuKernelComponentGroup::add_component().
|
staticconstexpr |
Maximum number of components that can be fused into the same component group.
Definition at line 67 of file GpuKernelComponentGroup.h.
Referenced by GpuKernelComponentGroup::add_component().