From 5e842512d1f1f47a61df56556f33625e071704c3 Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Tue, 25 Jul 2023 22:32:05 +0100 Subject: 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 Change-Id: I17c176220201ff92954ab5808fa1c1f29966d4e9 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9993 Benchmark: Arm Jenkins Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- compute_kernel_writer/src/ITile.h | 74 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'compute_kernel_writer/src/ITile.h') diff --git a/compute_kernel_writer/src/ITile.h b/compute_kernel_writer/src/ITile.h index a54fd9b794..b5585abcdf 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 @@ struct TileVariable 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 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 @@ public: */ virtual std::vector 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 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 */ -- cgit v1.2.1