24.04
|
The argument of a dynamic fusion component which can be either user tensor or virtual tensor. More...
#include <GpuCkwComponentArgument.h>
Public Member Functions | |
GpuCkwComponentArgument ()=default | |
Default constructor. More... | |
GpuCkwComponentArgument (ckw::TensorOperand tensor) | |
Initialize a new instance of GpuCkwComponentArgument class for user tensor. More... | |
GpuCkwComponentArgument & | init_virtual_tensor (ckw::TileOperand &tile, const ckw::TensorSampler &sampler) |
Bind the tile and sampler to the tensor argument. More... | |
bool | has_tensor () const |
Get whether the argument is a user tensor. More... | |
ckw::TensorOperand & | tensor () |
Get the tensor operand. More... | |
const ckw::TensorOperand & | tensor () const |
Get the tensor operand. More... | |
bool | has_tile () const |
Get whether the argument contains a tile. More... | |
ckw::TileOperand & | tile () |
Get the tile operand. More... | |
const ckw::TileOperand & | tile () const |
Get the tile operand. More... | |
ckw::TensorSampler & | tensor_sampler () |
Get the tensor sampling information for the tile. More... | |
const ckw::TensorSampler & | tensor_sampler () const |
Get the tensor sampling information for the tile. More... | |
The argument of a dynamic fusion component which can be either user tensor or virtual tensor.
Definition at line 40 of file GpuCkwComponentArgument.h.
|
default |
Default constructor.
|
explicit |
Initialize a new instance of GpuCkwComponentArgument class for user tensor.
[in] | tensor | The user tensor. |
Definition at line 36 of file GpuCkwComponentArgument.cpp.
bool has_tensor | ( | ) | const |
Get whether the argument is a user tensor.
Definition at line 51 of file GpuCkwComponentArgument.cpp.
bool has_tile | ( | ) | const |
Get whether the argument contains a tile.
The argument can be either a user tensor that has been loaded, or a virtual tensor (i.e. a tile with tensor sampling information).
Definition at line 70 of file GpuCkwComponentArgument.cpp.
Referenced by GpuCkwElementwiseBinary::write_component_code(), and GpuCkwDirectConv2d::write_component_code().
GpuCkwComponentArgument & init_virtual_tensor | ( | ckw::TileOperand & | tile, |
const ckw::TensorSampler & | sampler | ||
) |
Bind the tile and sampler to the tensor argument.
This method can be used to share a tile and sampler associated to a tensor among different kernel components. For example, when we create the destination tile and destination sampler for the first time (root component), this method can be used to bind these two information to the destination tensor so that the following simple components know the tile size and how to access the elements from memory.
[in] | tile | The tile that has been loaded. |
[in] | sampler | The tensor sampling information that has been used to load the tile. |
Definition at line 40 of file GpuCkwComponentArgument.cpp.
References GpuCkwComponentArgument::tile().
Referenced by GpuCkwElementwiseBinary::write_component_code(), and GpuCkwDirectConv2d::write_component_code().
const ckw::TensorOperand & tensor | ( | ) |
Get the tensor operand.
If the tensor is not available, throw an error.
Definition at line 56 of file GpuCkwComponentArgument.cpp.
Referenced by GpuCkwElementwiseBinary::write_component_code(), GpuCkwDepthwiseConv2d::write_component_code(), GpuCkwDirectConv2d::write_component_code(), and GpuCkwMatMul::write_component_code().
const ckw::TensorOperand& tensor | ( | ) | const |
Get the tensor operand.
If the tensor is not available, throw an error.
const ckw::TensorSampler & tensor_sampler | ( | ) |
Get the tensor sampling information for the tile.
If the tile is not available, throw an error.
Definition at line 89 of file GpuCkwComponentArgument.cpp.
const ckw::TensorSampler& tensor_sampler | ( | ) | const |
Get the tensor sampling information for the tile.
If the tile is not available, throw an error.
const ckw::TileOperand & tile | ( | ) |
Get the tile operand.
If the tile is not available, throw an error.
Definition at line 75 of file GpuCkwComponentArgument.cpp.
Referenced by GpuCkwComponentArgument::init_virtual_tensor(), GpuCkwElementwiseBinary::write_component_code(), and GpuCkwDirectConv2d::write_component_code().
const ckw::TileOperand& tile | ( | ) | const |
Get the tile operand.
If the tile is not available, throw an error.