24.02.1
|
An interface used by GpuCkwDriver to write source code for a kernel component. More...
#include <IGpuCkwComponentDriver.h>
Public Types | |
using | ComponentGroup = GpuKernelComponentGroup |
Public Member Functions | |
IGpuCkwComponentDriver (ComponentId id, const ArgumentPack< ITensorInfo > &tensors) | |
Constructor. More... | |
virtual | ~IGpuCkwComponentDriver () |
Destructor. More... | |
virtual void | write_component_code (const ComponentGroup &comp_group, GpuCkwVariableTable &vtable, GpuCkwScopedKernelWriter writer) const =0 |
Generate kernel component code. More... | |
ArgumentPack< ITensorInfo > | tensors () const |
Get tensor arguments. More... | |
virtual Window | get_window () const |
Generate the execution window for the component. More... | |
virtual std::string | get_name (const ComponentGroup &comp_group) const |
Generate the name of the component. More... | |
virtual std::string | get_tuner_id (const ComponentGroup &comp_group) const |
Generate the tuner id of the component This id should capture all the parameters that distinguish one kernel's lws tuning from another. More... | |
ComponentId | id () const |
Get component id. More... | |
An interface used by GpuCkwDriver to write source code for a kernel component.
There are 3 main architecture layers for using Compute Kernel Writer (Ckw) inside ACL's dynamic fusion module From top level to bottom level:
| dynamic_fusion | acl | ckw_driver | acl | ckw | ckw
ckw_driver is a glue layer that directs how fused code is produced using the ckw library
There are two main groups within ckw_driver:
The overall flow goes like this: In dynamic_fusion module, GpuLogicalKernel instantiates a GpuCkwDriver from a GpuKernelComponentGroup The logical kernel then uses the global driver's various interfaces to generate the code info. In particular, the GpuCkwDriver::get_code() interface will call into each IGpuCkwComponentDriver::write_component_code()
Definition at line 66 of file IGpuCkwComponentDriver.h.
Definition at line 69 of file IGpuCkwComponentDriver.h.
|
inline |
Constructor.
[in] | id | Component id |
[in] | tensors | Tensor arguments to the components |
Definition at line 77 of file IGpuCkwComponentDriver.h.
|
inlinevirtual |
|
inlinevirtual |
Generate the name of the component.
This will be concatenated with other components' names to form the name of the kernel
Reimplemented in GpuCkwMatMul, GpuCkwDirectConv2d, GpuCkwPool2d, GpuCkwResize, GpuCkwElementwiseBinary, and GpuCkwStore.
Definition at line 109 of file IGpuCkwComponentDriver.h.
References ARM_COMPUTE_UNUSED.
|
inlinevirtual |
Generate the tuner id of the component This id should capture all the parameters that distinguish one kernel's lws tuning from another.
e.g. two components that are identical in every other way, but have output tensor dimensions should have different tuner ids, because the lws of one may not be optimal on the other.
This will be concatenated with other components' tuner id to form the tuner id of the kernel
Reimplemented in GpuCkwResize.
Definition at line 121 of file IGpuCkwComponentDriver.h.
References ARM_COMPUTE_UNUSED.
|
inlinevirtual |
Generate the execution window for the component.
Reimplemented in GpuCkwMatMul, GpuCkwDirectConv2d, GpuCkwDepthwiseConv2d, GpuCkwPool2d, GpuCkwResize, GpuCkwActivation, GpuCkwCast, and GpuCkwElementwiseBinary.
Definition at line 101 of file IGpuCkwComponentDriver.h.
Referenced by GpuCkwActivation::write_component_code(), GpuCkwCast::write_component_code(), GpuCkwElementwiseBinary::write_component_code(), GpuCkwPool2d::write_component_code(), GpuCkwDepthwiseConv2d::write_component_code(), GpuCkwDirectConv2d::write_component_code(), and GpuCkwMatMul::write_component_code().
|
inline |
Get component id.
Definition at line 127 of file IGpuCkwComponentDriver.h.
Referenced by GpuCkwActivation::GpuCkwActivation(), GpuCkwCast::GpuCkwCast(), GpuCkwDepthwiseConv2d::GpuCkwDepthwiseConv2d(), GpuCkwDirectConv2d::GpuCkwDirectConv2d(), GpuCkwElementwiseBinary::GpuCkwElementwiseBinary(), GpuCkwMatMul::GpuCkwMatMul(), GpuCkwPool2d::GpuCkwPool2d(), GpuCkwResize::GpuCkwResize(), and GpuCkwStore::GpuCkwStore().
|
inline |
Get tensor arguments.
Definition at line 96 of file IGpuCkwComponentDriver.h.
Referenced by GpuCkwActivation::GpuCkwActivation(), GpuCkwCast::GpuCkwCast(), GpuCkwDepthwiseConv2d::GpuCkwDepthwiseConv2d(), GpuCkwDirectConv2d::GpuCkwDirectConv2d(), GpuCkwElementwiseBinary::GpuCkwElementwiseBinary(), GpuCkwMatMul::GpuCkwMatMul(), GpuCkwPool2d::GpuCkwPool2d(), GpuCkwResize::GpuCkwResize(), and GpuCkwStore::GpuCkwStore().
|
pure virtual |
Generate kernel component code.
[in] | comp_group | Component group of which the component is a part of |
[in,out] | vtable | Table of variables declared by each component |
[in,out] | writer | CKW writer that writes code scoped to this kernel component. @note @p writer can only be passed via value since the new scope is created in the copy constructor |
Implemented in GpuCkwMatMul, GpuCkwDirectConv2d, GpuCkwDepthwiseConv2d, GpuCkwPool2d, GpuCkwResize, GpuCkwActivation, GpuCkwCast, GpuCkwElementwiseBinary, and GpuCkwStore.