aboutsummaryrefslogtreecommitdiff
path: root/compute_kernel_writer/src/cl/CLKernelWriter.h
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-07-20 17:31:47 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-07-21 13:33:12 +0000
commit25d26f4d86042e0ca52ac1bef4039b187f77b5b3 (patch)
tree9a4ee7d5173883a2c67a68689d591efd746f2b5f /compute_kernel_writer/src/cl/CLKernelWriter.h
parent8dfb8820d5fe0f72a923eccc3bb73ee0b87d5511 (diff)
downloadComputeLibrary-25d26f4d86042e0ca52ac1bef4039b187f77b5b3.tar.gz
Change TileOperand to a view of a tile object
* TileOperand instead of being the tile object now is only a view of a tile object. - declare_tile now returns a TileOperand object, not a reference to a TileOperand object. - This is to prepare for the posibility that the users need to perform operations on part of a tile (e.g. a scalar value, a vector, a sub-tile). Partially resolves: COMPMID-6391 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I35c08b22a384a756d99dcd04cbe66fc57bd548d2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9958 Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/src/cl/CLKernelWriter.h')
-rw-r--r--compute_kernel_writer/src/cl/CLKernelWriter.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.h b/compute_kernel_writer/src/cl/CLKernelWriter.h
index 5bf7293ae2..c69a0bc07e 100644
--- a/compute_kernel_writer/src/cl/CLKernelWriter.h
+++ b/compute_kernel_writer/src/cl/CLKernelWriter.h
@@ -26,7 +26,10 @@
#define CKW_SRC_CL_CLKERNELWRITER_H
#include "ckw/KernelWriter.h"
+#include "src/cl/CLTile.h"
+#include <memory>
+#include <set>
#include <utility>
namespace ckw
@@ -62,8 +65,7 @@ public:
*
* Similar to @ref KernelWriter::declare_tile()
*/
- TileOperand &declare_tile(const ::std::string &name, const TileInfo &tile_info) override;
-
+ TileOperand declare_tile(const std::string &name, const TileInfo &tile_info) override;
protected:
/** Append the specified code to the kernel body source code. */
@@ -84,9 +86,6 @@ protected:
/** Get the current kernel body source code. */
const std::string &body_source_code() const;
- /** Add a tile operand to the kernel and return it */
- 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.
* The full source code will only be generated when the user calls @ref KernelWriter::emit_kernel.
@@ -95,6 +94,8 @@ private:
* Do not attempt to concatenate and alter this string directly.
*/
std::string _body_source_code{};
+
+ std::set<std::unique_ptr<CLTile>> _tiles{};
};
} // namespace ckw