aboutsummaryrefslogtreecommitdiff
path: root/compute_kernel_writer/prototype/include/ckw/TileOperand.h
diff options
context:
space:
mode:
authorJakub Sujak <jakub.sujak@arm.com>2023-07-31 13:36:58 +0100
committerJakub Sujak <jakub.sujak@arm.com>2023-08-07 08:44:17 +0000
commite1c96e7e6dbf5314676fc81831e2ccb34a031ea1 (patch)
treef69ee0ac5dd6b29de0041293b279804bcecf0df7 /compute_kernel_writer/prototype/include/ckw/TileOperand.h
parent78ce2730ecd2f1e666cdd10263bf054c0b740a9c (diff)
downloadComputeLibrary-e1c96e7e6dbf5314676fc81831e2ccb34a031ea1.tar.gz
Port DirectConv2d to CKW backend
Ports the direct convolution 2D kernel from the experimental Dynamic Fusion interface to use the new Compute Kernel Writer backend for OpenCL code generation. Support is for FP16/FP32 only. Resolves: COMPMID-6259 Change-Id: Ia8d7b9cb789737b22b1d877cd798a73eda0ce4ab Signed-off-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10059 Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@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/prototype/include/ckw/TileOperand.h')
-rw-r--r--compute_kernel_writer/prototype/include/ckw/TileOperand.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/compute_kernel_writer/prototype/include/ckw/TileOperand.h b/compute_kernel_writer/prototype/include/ckw/TileOperand.h
index c071707a45..24ee373a24 100644
--- a/compute_kernel_writer/prototype/include/ckw/TileOperand.h
+++ b/compute_kernel_writer/prototype/include/ckw/TileOperand.h
@@ -37,6 +37,8 @@ namespace ckw
class Kernel;
+using TileContainer = std::vector<std::vector<std::string>>;
+
/** Tile operand which can be either scalar, vector or 2D tile. */
class TileOperand : public OperandBase
{
@@ -69,6 +71,13 @@ public:
*/
TileOperand(const ::std::string &name, float value);
+ /** Initialize a new instance of @ref TileOperand for compile-time constant variable.
+ *
+ * @param[in] name The name of the tile.
+ * @param[in] value The value of the tile.
+ */
+ TileOperand(const ::std::string &name, const ::std::vector<std::vector<std::string>> &value, DataType dt);
+
/** Prohibit copy of tile operand. */
TileOperand(const TileOperand &) = delete;
@@ -96,13 +105,21 @@ public:
/** Get the scalar value of the tile.
*
* The tile must have the shape of 1, 1 (i.e. scalar).
+ *
+ * @return Scalar value as a string.
+ */
+ std::string scalar_value() const;
+
+ /** Get the values of the tile.
+ *
+ * @return 2D container of values.
*/
- ScalarValue scalar_value() const;
+ const TileContainer &value() const;
private:
- TileInfo _info;
- ScalarValue _value{};
- bool _constant;
+ TileInfo _info;
+ TileContainer _value{};
+ bool _constant;
};
} // namespace ckw