29 #include "tests/datasets/MatMulLowpMMULDataset.h"
33 #include "tests/validation/fixtures/MatMulKernelFixture.h"
75 using MatMulConfigurationPair = std::pair<MatMulKernelInfo, bool>;
77 const std::vector<MatMulConfigurationPair> supported_block_sizes =
82 { MatMulKernelInfo(
false,
false, 3, 6, 4),
false },
83 { MatMulKernelInfo(
false,
false, 3, 3, 8),
false },
84 { MatMulKernelInfo(
true,
false, 5, 3, 4),
false },
85 { MatMulKernelInfo(
false,
false, 9, 1, 4),
true },
86 { MatMulKernelInfo(
false,
true, 3, 16, 4),
true },
87 { MatMulKernelInfo(
false,
false, 7, 3, 4),
true },
88 { MatMulKernelInfo(
true,
false, 8, 3, 4),
true },
89 { MatMulKernelInfo(
true,
true, 4, 3, 4),
true },
90 { MatMulKernelInfo(
false,
false, 7, 3, 4,
true),
false },
99 for(
auto &pair : supported_block_sizes)
112 using ShapeConfigurationTuple = std::tuple<TensorShape, TensorShape, TensorShape, bool>;
113 const std::vector<ShapeConfigurationTuple> shape_configurations =
115 { TensorShape(32U, 1U), TensorShape(3U, 32U), TensorShape(3U),
true },
116 { TensorShape(16U, 12U), TensorShape(3U, 16U), TensorShape(3U),
true },
117 { TensorShape(64U, 4U), TensorShape(2U, 64U), TensorShape(2U),
true },
118 { TensorShape(16U, 4U), TensorShape(2U, 32U), TensorShape(2U),
false },
119 { TensorShape(16U, 0U), TensorShape(2U, 16U), TensorShape(2U),
false },
120 { TensorShape(32U, 4U, 3U, 4U, 5U, 6U), TensorShape(2U, 32U, 3U, 4U, 5U, 6U), TensorShape(2U),
true },
121 { TensorShape(32U, 4U, 3U, 4U, 5U, 1U), TensorShape(2U, 32U, 3U, 4U, 5U, 6U), TensorShape(2U),
false },
122 { TensorShape(32U, 4U, 3U, 4U, 9U, 6U), TensorShape(2U, 32U, 3U, 4U, 5U, 6U), TensorShape(2U),
false },
123 { TensorShape(32U, 1U), TensorShape(3U, 32U), TensorShape(1U),
false },
124 { TensorShape(32U, 1U), TensorShape(3U, 32U), TensorShape(3U, 3U),
false },
125 { TensorShape(12U, 12U), TensorShape(3U, 12U), TensorShape(3U),
false },
128 for(
auto &tuple : shape_configurations)
142 TensorShape lhs_shape = std::get<0>(tuple);
143 TensorShape rhs_shape = std::get<1>(tuple);
144 TensorShape bia_shape = std::get<2>(tuple);
158 const TensorInfo bia_info = TensorInfo(bia_shape, 1,
DataType::S32);
161 MatMulKernelInfo matmul_kernel_info{ adj_lhs, adj_rhs, 1, 1, 4,
false };
172 using DataTypeConfigurationTuple = std::tuple<DataType, DataType, DataType, DataType, bool>;
173 const std::vector<DataTypeConfigurationTuple> data_type_configurations =
197 const TensorShape
shape = TensorShape(48U, 48U);
198 const TensorShape bia_shape = TensorShape(48U);
199 const MatMulKernelInfo matmul_kernel_info{
false,
false, 1, 1, 4,
false };
200 for(
auto &tuple : data_type_configurations)
204 const TensorInfo lhs_info(
shape, 1, std::get<0>(tuple));
205 const TensorInfo rhs_info(
shape, 1, std::get<1>(tuple));
206 const TensorInfo bia_info(bia_shape, 1, std::get<2>(tuple));
222 combine(datasets::SmallMatMulLowpMMULDataset(),
223 make("TransposeA", {
false,
true }),
224 make(
"TransposeB", {
false,
true }),
228 make(
"ExportRhsToCLImage", {
false }),
231 if(_device_supports_mmul)
240 combine(datasets::SmallMatMulLowpMMULWithBiasDataset(),
241 make(
"TransposeA", {
false,
true }),
242 make(
"TransposeB", {
false,
true }),
246 make(
"ExportRhsToCLImage", {
false }),
249 if(_device_supports_mmul)
258 combine(datasets::LargeMatMulLowpMMULDataset(),
259 make(
"TransposeA", {
false }),
260 make(
"TransposeB", {
false,
true }),
264 make(
"ExportRhsToCLImage", {
false }),
267 if(_device_supports_mmul)
276 combine(datasets::LargeMatMulLowpMMULDataset(),
277 make(
"TransposeA", {
true }),
278 make(
"TransposeB", {
false,
true }),
282 make(
"ExportRhsToCLImage", {
false }),
285 if(_device_supports_mmul)
296 combine(datasets::HighDimensionalMatMulLowpMMULDataset(),
297 make(
"TransposeA", {
false,
true }),
298 make(
"TransposeB", {
false,
true }),
302 make(
"ExportRhsToCLImage", {
false }),
305 if(_device_supports_mmul)
318 combine(datasets::SmallMatMulLowpMMULDatasetSubset(),
319 make("TransposeA", {
false,
true }),
320 make(
"TransposeB", {
false,
true }),
324 make(
"ExportRhsToCLImage", {
false }),
327 if(_device_supports_mmul)
336 combine(datasets::SmallMatMulLowpMMULWithBiasDataset(),
337 make(
"TransposeA", {
false,
true }),
338 make(
"TransposeB", {
false,
true }),
342 make(
"ExportRhsToCLImage", {
false }),
345 if(_device_supports_mmul)
354 combine(datasets::LargeMatMulLowpMMULDataset(),
355 make(
"TransposeA", {
false }),
356 make(
"TransposeB", {
false,
true }),
360 make(
"ExportRhsToCLImage", {
false }),
363 if(_device_supports_mmul)
372 combine(datasets::LargeMatMulLowpMMULDataset(),
373 make(
"TransposeA", {
true }),
374 make(
"TransposeB", {
false,
true }),
378 make(
"ExportRhsToCLImage", {
false }),
381 if(_device_supports_mmul)