diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2023-07-12 14:50:56 +0100 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2023-07-12 15:23:55 +0000 |
commit | 3c776066a0195f2e99d3503f8b058e468d53b884 (patch) | |
tree | f91268d28eed0a3446330385185898f6d6aa17f6 /compute_kernel_writer/src/cl | |
parent | 945b8da90cea5ccacc0294e58131f73f39137367 (diff) | |
download | ComputeLibrary-3c776066a0195f2e99d3503f8b058e468d53b884.tar.gz |
Rename ITileOperand and introduce vector/scalar interfaces in CKW
Partially Resolves: COMPMID-5788
This patch
- renames ITileOperand to TileOperand, which seems to be a more intuitive name for the prospective users of Compute Kernel Writer
- provides IScalarAccess and IVectorAccess interfaces to be used by Tile classes. It replaces the current IScalarTile and IVectorTile, and forms a more intuitive inheritance hierarchy where each subclass "is a" member of the parent class semantically.
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I2b5253b0595e63f8ff3047c608d593b3b364634d
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9910
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/src/cl')
-rw-r--r-- | compute_kernel_writer/src/cl/CLKernelWriter.cpp | 6 | ||||
-rw-r--r-- | compute_kernel_writer/src/cl/CLKernelWriter.h | 5 | ||||
-rw-r--r-- | compute_kernel_writer/src/cl/CLTile.h | 4 | ||||
-rw-r--r-- | compute_kernel_writer/src/cl/ICLTile.h | 3 |
4 files changed, 10 insertions, 8 deletions
diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.cpp b/compute_kernel_writer/src/cl/CLKernelWriter.cpp index 7faf2e6d60..2f8b1c95ce 100644 --- a/compute_kernel_writer/src/cl/CLKernelWriter.cpp +++ b/compute_kernel_writer/src/cl/CLKernelWriter.cpp @@ -61,7 +61,7 @@ const std::string &CLKernelWriter::body_source_code() const return _body_source_code; } -ITileOperand &CLKernelWriter::declare_tile(const std::string &name, const TileInfo &tile_info) +TileOperand &CLKernelWriter::declare_tile(const std::string &name, const TileInfo &tile_info) { const std::string fullname = generate_full_name(name); @@ -78,9 +78,9 @@ ITileOperand &CLKernelWriter::declare_tile(const std::string &name, const TileIn return add_operand(fullname, tile_info); } -ITileOperand &CLKernelWriter::add_operand(const std::string &name, const TileInfo &tile_info) +TileOperand &CLKernelWriter::add_operand(const std::string &name, const TileInfo &tile_info) { - std::unique_ptr<ITileOperand> operand = std::make_unique<CLTile>(name, tile_info); + std::unique_ptr<TileOperand> operand = std::make_unique<CLTile>(name, tile_info); return KernelWriter::add_operand(operand); } diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.h b/compute_kernel_writer/src/cl/CLKernelWriter.h index d0c4b7c9d4..5bf7293ae2 100644 --- a/compute_kernel_writer/src/cl/CLKernelWriter.h +++ b/compute_kernel_writer/src/cl/CLKernelWriter.h @@ -26,6 +26,7 @@ #define CKW_SRC_CL_CLKERNELWRITER_H #include "ckw/KernelWriter.h" + #include <utility> namespace ckw @@ -61,7 +62,7 @@ public: * * Similar to @ref KernelWriter::declare_tile() */ - ITileOperand &declare_tile(const ::std::string &name, const TileInfo &tile_info) override; + TileOperand &declare_tile(const ::std::string &name, const TileInfo &tile_info) override; protected: @@ -84,7 +85,7 @@ protected: const std::string &body_source_code() const; /** Add a tile operand to the kernel and return it */ - ITileOperand &add_operand(const std::string &code, const TileInfo &tile_info) override; + TileOperand &add_operand(const std::string &code, const TileInfo &tile_info) override; private: /** This string contains the kernel body source code, not the full CL source code. diff --git a/compute_kernel_writer/src/cl/CLTile.h b/compute_kernel_writer/src/cl/CLTile.h index 7e69de847b..b9d4bbaf84 100644 --- a/compute_kernel_writer/src/cl/CLTile.h +++ b/compute_kernel_writer/src/cl/CLTile.h @@ -26,7 +26,7 @@ #include "src/ITile.h" #include "src/cl/ICLTile.h" -#include "ckw/ITileOperand.h" +#include "ckw/TileOperand.h" #include <string> @@ -36,7 +36,7 @@ namespace ckw class TileInfo; /** OpenCL specific tile */ -class CLTile : public ICLTile, public ITileOperand +class CLTile : public ICLTile, public TileOperand { public: /** Constructor diff --git a/compute_kernel_writer/src/cl/ICLTile.h b/compute_kernel_writer/src/cl/ICLTile.h index b02bc037af..17c44d1d3e 100644 --- a/compute_kernel_writer/src/cl/ICLTile.h +++ b/compute_kernel_writer/src/cl/ICLTile.h @@ -32,7 +32,8 @@ namespace ckw class TileInfo; /** Interface for the OpenCL specific tile */ -class ICLTile : public IVectorTile +class ICLTile : public ITile, // classes inherited + public IVectorAccess, public IScalarAccess // interfaces implemented { public: // Inherited method overridden |