From 806b8e856911e6691ede6725c7e2a0e7e0dd6e95 Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Wed, 23 Aug 2023 23:28:31 +0100 Subject: Add declare_constant_tile API function in CKW Resolves: COMPMID-6535 Change-Id: I07d8aca96a0fcbd624f828b24513ee0500a14a74 Signed-off-by: Gunes Bayir Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10200 Reviewed-by: Viet-Hoa Do Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- compute_kernel_writer/src/cl/CLKernelWriter.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'compute_kernel_writer/src/cl/CLKernelWriter.h') diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.h b/compute_kernel_writer/src/cl/CLKernelWriter.h index 2a6b79c691..d2c84f192e 100644 --- a/compute_kernel_writer/src/cl/CLKernelWriter.h +++ b/compute_kernel_writer/src/cl/CLKernelWriter.h @@ -29,17 +29,21 @@ #include #include +#include #include namespace ckw { +// Forward Declarations class CLTile; class CLTensorArgument; +class ConstantData; +class TensorOperand; class TensorSampler; class TileOperand; -class TensorOperand; +enum class DataType; enum class MemoryOperation; /** OpenCL kernel writer. */ @@ -96,6 +100,12 @@ public: */ TileOperand declare_tile(const std::string &name, const TileInfo &tile_info) override; + /** Declare a constant tile given a @ref:ConstantData object + * + * Similar to @ref KernelWriter::declare_constant_tile() + */ + TileOperand declare_constant_tile(const ConstantData &data) override; + // ============================================================================================= // Memory Operations // ============================================================================================= @@ -139,7 +149,7 @@ protected: * * This function performs appropriate check before doing type casting. */ - const CLTile &to_cl_tile(const TileOperand &operand); + const CLTile &to_cl_tile(const TileOperand &operand) const; /** Append the specified code to the kernel body source code. */ template @@ -179,6 +189,7 @@ private: std::set> _tensors{}; std::set> _tiles{}; + std::set> _constant_tiles{}; }; } // namespace ckw -- cgit v1.2.1