diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-07-25 14:00:46 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-07-27 14:34:04 +0000 |
commit | 0b23e0e6402cb18ddf621d36454cadbb73959518 (patch) | |
tree | 244c32e5a44a8c2a644cb6a1e965c114175d2515 /compute_kernel_writer/include/ckw/KernelWriter.h | |
parent | 9662ac062bafe454afb77a563648e5577c5a8360 (diff) | |
download | ComputeLibrary-0b23e0e6402cb18ddf621d36454cadbb73959518.tar.gz |
Add TensorOperand and declare tensor argument
Partially resolves: COMPMID-6391
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I849d486401f99a93919015f2e173559dca5bffa2
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9972
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/include/ckw/KernelWriter.h')
-rw-r--r-- | compute_kernel_writer/include/ckw/KernelWriter.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/compute_kernel_writer/include/ckw/KernelWriter.h b/compute_kernel_writer/include/ckw/KernelWriter.h index cfd24d35a3..894f7b6758 100644 --- a/compute_kernel_writer/include/ckw/KernelWriter.h +++ b/compute_kernel_writer/include/ckw/KernelWriter.h @@ -25,6 +25,7 @@ #ifndef CKW_INCLUDE_CKW_KERNELWRITER_H #define CKW_INCLUDE_CKW_KERNELWRITER_H +#include "ckw/TensorOperand.h" #include "ckw/TileOperand.h" #include <memory> @@ -36,6 +37,7 @@ namespace ckw class Kernel; /** Forward Declerations */ +class TensorInfo; class TileInfo; enum class TargetArchitecture; enum class TargetLanguage; @@ -95,6 +97,19 @@ public: */ virtual std::unique_ptr<Kernel> emit_kernel(const std::string &name) = 0; + // ============================================================================================= + // Tensor and tile declaration + // ============================================================================================= + + /** Declare a tensor argument. + * + * @param[in] name The name of the tensor. + * @param[in] info The tensor info. + * + * @return The @ref TensorOperand object. + */ + virtual TensorOperand declare_tensor_argument(const std::string &name, const TensorInfo &info) = 0; + /** Declare a tile given its name and tile info * * @param[in] name Name of the tile @@ -110,20 +125,18 @@ protected: /** Generate full variable name by prefixing it with id space */ std::string generate_full_name(const std::string &name) const; - /** Create a new tile operand referring to the specified tile object. - * - * This class has friendship relationship with @ref TileOperand which allows it - * to access the private constructor. - */ + /** Create a new tile operand referring to the specified tile object. */ static TileOperand create_tile_operand(ITile &tile); - /** Get the reference to tile object from the tile operand. - * - * This class has friendship relationship with @ref TileOperand which allows it - * to access the private reference to the private tile field. - */ + /** Get the reference to tile object from the tile operand. */ static ITile &get_tile(const TileOperand &operand); + /** Create a new tensor operand from a tensor object. */ + static TensorOperand create_tensor_operand(ITensor &tensor); + + /** Get the reference to tensor object from the tensor operand. */ + static ITensor &get_tensor(const TensorOperand &operand); + private: int32_t _id_space{ 0 }; }; |