Add Tensor3dMapper to CKW

In CKW, tensors are assumed to be 3d, except the batch dimension. Tensor3dMapper class defines how an Nd tensor is mapped to 3d. It also provides utility functions to access certain dimensions and the associated strides.

Partially Resolves: COMPMID-5791

Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I17c176220201ff92954ab5808fa1c1f29966d4e9
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9993
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/compute_kernel_writer/src/ITile.h b/compute_kernel_writer/src/ITile.h
index a54fd9b..b5585ab 100644
--- a/compute_kernel_writer/src/ITile.h
+++ b/compute_kernel_writer/src/ITile.h
@@ -21,8 +21,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#ifndef COMPUTE_KERNEL_WRITER_SRC_ITILE
-#define COMPUTE_KERNEL_WRITER_SRC_ITILE
+#ifndef CKW_SRC_ITILE
+#define CKW_SRC_ITILE
 
 #include "ckw/TileInfo.h"
 
@@ -48,40 +48,6 @@
     TileVariableDescriptor desc{};    /** Tile value descriptor which reports the datatype and vector length */
 };
 
-/** Tile base class.
- *  A Tile is a collection of variables (either program variables or constants) used to express a 2D data.
- */
-class ITile
-{
-public:
-    virtual ~ITile() = default;
-
-    /** Method to get all TileVariable objects
-     *
-     * @return a vector containing all @ref TileVariable objects
-     */
-    virtual std::vector<TileVariable> all() const = 0;
-
-    /** Method to get the name of the tile.
-     *
-     * @return the name of the tile
-     */
-    virtual const std::string &name() const = 0;
-
-    /** Method to get the tile info
-     *
-     * @return the @ref TileInfo
-     */
-    virtual const TileInfo &info() const = 0;
-
-    /** Method to know whether the tile is assignable or not.
-     *  For example, a constant tile is not assignable.
-     *
-     * @return true if the tile is assignable
-     */
-    virtual bool is_assignable() const = 0;
-};
-
 /** Interface to provide support for scalar access for a Tile.
  */
 class IScalarAccess
@@ -130,6 +96,40 @@
      */
     virtual std::vector<int32_t> supported_vector_lengths() const = 0;
 };
+
+/** Tile base class.
+ *  A Tile is a collection of variables (either program variables or constants) used to express a 2D data.
+ */
+class ITile: public IScalarAccess
+{
+public:
+    virtual ~ITile() = default;
+
+    /** Method to get all TileVariable objects
+     *
+     * @return a vector containing all @ref TileVariable objects
+     */
+    virtual std::vector<TileVariable> all() const = 0;
+
+    /** Method to get the name of the tile.
+     *
+     * @return the name of the tile
+     */
+    virtual const std::string &name() const = 0;
+
+    /** Method to get the tile info
+     *
+     * @return the @ref TileInfo
+     */
+    virtual const TileInfo &info() const = 0;
+
+    /** Method to know whether the tile is assignable or not.
+     *  For example, a constant tile is not assignable.
+     *
+     * @return true if the tile is assignable
+     */
+    virtual bool is_assignable() const = 0;
+};
 } // namespace ckw
 
-#endif /* COMPUTE_KERNEL_WRITER_SRC_ITILE */
+#endif /* CKW_SRC_ITILE */