blob: 1b22e1061f70ecdc3e9af8faff5227ddf4349c0d [file] [log] [blame]
Gunes Bayira116cd32023-09-13 11:59:34 +01001/*
2 * Copyright (c) 2023 Arm Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef ACL_TESTS_DATASETS_MATMULLOWPMMULDATASET_H
26#define ACL_TESTS_DATASETS_MATMULLOWPMMULDATASET_H
27
28#include "arm_compute/core/TensorShape.h"
29#include "arm_compute/core/Types.h"
30#include "tests/datasets/MatMulDataset.h"
31
32namespace arm_compute
33{
34namespace test
35{
36namespace datasets
37{
38/** MatMulLowp MMUL shapes are similar to MatMul MMUL shapes except that K has to be a
39 * multiple of MMUL_K0 which is 16 (e.g. see src/gpu/cl/kernels/ClMatMulLowpNativeMMULKernel.cpp for the definition)
40 */
41class SmallMatMulLowpMMULDataset final : public MatMulDataset
42{
43public:
44 SmallMatMulLowpMMULDataset()
45 {
46 add_config(TensorShape(16U, 4U), TensorShape(4U, 16U), TensorShape(4U, 4U)); // same as mmul block
47 add_config(TensorShape(96U, 1U), TensorShape(1U, 96U), TensorShape(1U, 1U)); // vector x vector
48 add_config(TensorShape(32U, 4U, 2U), TensorShape(16U, 32U, 2U), TensorShape(16U, 4U, 2U));
49 add_config(TensorShape(48U, 2U), TensorShape(17U, 48U), TensorShape(17U, 2U));
50 add_config(TensorShape(32U, 6U), TensorShape(7U, 32U), TensorShape(7U, 6U));
51 }
52};
53
54// This dataset is for smaller number of tests that will still use small shapes
55// e.g. not repeating everything for QASYMM8 while we're already testing for QASYMM8_SIGNED
56class SmallMatMulLowpMMULDatasetSubset final : public MatMulDataset
57{
58public:
59 SmallMatMulLowpMMULDatasetSubset()
60 {
61 add_config(TensorShape(32U, 4U, 2U), TensorShape(16U, 32U, 2U), TensorShape(16U, 4U, 2U));
62 add_config(TensorShape(32U, 6U), TensorShape(7U, 32U), TensorShape(7U, 6U));
63 }
64};
65
66class SmallMatMulLowpMMULWithBiasDataset final : public MatMulDataset
67{
68public:
69 SmallMatMulLowpMMULWithBiasDataset()
70 {
71 add_config(TensorShape(32U, 4U, 2U, 2U), TensorShape(16U, 32U, 2U, 2U), TensorShape(16U, 4U, 2U, 2U));
72 }
73};
74
75class LargeMatMulLowpMMULDataset final : public MatMulDataset
76{
77public:
78 LargeMatMulLowpMMULDataset()
79 {
80 add_config(TensorShape(192U, 38U, 3U, 2U), TensorShape(21U, 192U, 3U, 2U), TensorShape(21U, 38U, 3U, 2U));
81 }
82};
83
84class HighDimensionalMatMulLowpMMULDataset final : public MatMulDataset
85{
86public:
87 HighDimensionalMatMulLowpMMULDataset()
88 {
89 add_config(TensorShape(16U, 5U, 2U, 2U, 2U, 2U), TensorShape(5U, 16U, 2U, 2U, 2U, 2U), TensorShape(5U, 5U, 2U, 2U, 2U, 2U)); // 6D tensor
90 }
91};
92
93} // namespace datasets
94} // namespace test
95} // namespace arm_compute
96
97#endif // ACL_TESTS_DATASETS_MATMULLOWPMMULDATASET_H