36 #include "tests/datasets/ShapeDatasets.h"
41 #include "tests/validation/fixtures/GEMMFixture.h"
63 using CLGEMMMatrixMultiplyReshapedFixture = GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
68 GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
73 GEMMMatrixMultiplyReshapedValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
78 GEMMMatrixMultiplyReshapedWithPostOpsValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
82 using CLGEMMMatrixMultiplyReshaped3DFixture = GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped>;
87 GEMMMatrixMultiplyReshaped3DValidationFixture<CLTensor, CLAccessor, T, CLGEMMReshapeLHSMatrix, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshaped, true>;
97 constexpr
float abs_tolerance_f16_mixed_precision(0.01f);
100 constexpr
float abs_tolerance_f16(0.01f);
194 std::make_tuple(
true,
true,
false),
204 std::make_tuple(
false,
true,
true),
215 std::make_tuple(
false,
false,
true),
226 std::make_tuple(
false,
false,
true),
238 std::make_tuple(
false,
false,
false),
272 ActivationLayerInfo::ActivationFunction::IDENTITY,
281 &reshaped_input1_info.
clone()->set_is_resizable(
true),
283 &
output_info.clone()->set_is_resizable(
true),1.f,1.f,
338 GEMMLHSMatrixInfo(4,4,1,
false,
true),
339 GEMMLHSMatrixInfo(4,4,1,
false,
true),
340 GEMMLHSMatrixInfo(4,4,1,
false,
true),
341 GEMMLHSMatrixInfo(4,2,4,
false,
false),
342 GEMMLHSMatrixInfo(4,2,4,
false,
false),
343 GEMMLHSMatrixInfo(4,4,1,
false,
true),
344 GEMMLHSMatrixInfo(4,4,1,
false,
true),
345 GEMMLHSMatrixInfo(4,4,1,
false,
true),
349 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
350 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
351 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
352 GEMMRHSMatrixInfo(2,2,1,
true,
false,
false),
353 GEMMRHSMatrixInfo(2,2,1,
true,
false,
false),
354 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
355 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
356 GEMMRHSMatrixInfo(4,4,2,
true,
false,
false),
370 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
373 GEMMLHSMatrixInfo(4,4,1,
false,
true),
374 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
385 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
388 GEMMLHSMatrixInfo(4,4,1,
false,
true),
389 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
403 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
406 GEMMLHSMatrixInfo(4,4,1,
false,
true),
407 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
419 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
422 GEMMLHSMatrixInfo(4,4,1,
false,
true),
423 GEMMRHSMatrixInfo(4,4,1,
true,
true,
false),
434 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
437 GEMMLHSMatrixInfo(4,4,1,
false,
true),
438 GEMMRHSMatrixInfo(4,4,2,
true,
false,
false),
448 &
output_info.clone()->set_is_resizable(
true),1.f,1.f,
458 const unsigned int m = 17;
459 const unsigned int n = 1;
460 const unsigned int k = 13;
461 const unsigned int batch = 2;
462 TensorShape post_op_arg0_shape(
n,
m,
batch);
463 TensorInfo post_op_arg_info(post_op_arg0_shape, 1,
data_type);
464 auto post_op_arg1_info = post_op_arg_info.clone();
467 experimental::PostOpList<ITensorInfo*>
post_ops{};
468 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>(
472 post_ops.push_back_op<experimental::PostOpEltwiseAdd<ITensorInfo*>>(
473 post_op_arg1_info.get(),
483 const unsigned int m = 17;
484 const unsigned int n = 1;
485 const unsigned int k = 13;
486 const unsigned int batch = 2;
487 TensorShape post_op_arg_shape(
n + 4,
m,
batch);
488 TensorInfo post_op_arg_info(post_op_arg_shape, 1,
data_type);
489 experimental::PostOpList<ITensorInfo*>
post_ops{};
498 const unsigned int m = 22;
499 const unsigned int n = 16;
500 const unsigned int k = 15;
501 const unsigned int batch = 3;
502 TensorShape post_op_arg_shape(1,
m,
batch);
503 TensorInfo post_op_arg_info(post_op_arg_shape, 1,
data_type);
504 experimental::PostOpList<ITensorInfo*>
post_ops{};
514 const unsigned int m = 22;
515 const unsigned int n = 16;
516 const unsigned int k = 15;
517 const unsigned int batch = 3;
518 experimental::PostOpList<ITensorInfo*>
post_ops{};
525 const unsigned int m = 22;
526 const unsigned int n = 16;
527 const unsigned int k = 15;
528 const unsigned int batch = 3;
529 TensorShape post_op_arg_shape(
n, 1,
batch);
530 TensorInfo post_op_arg_info(post_op_arg_shape, 1,
data_type);
531 experimental::PostOpList<ITensorInfo*>
post_ops{};
539 const unsigned int m = 22;
540 const unsigned int n = 16;
541 const unsigned int k = 15;
542 const unsigned int batch = 3;
543 TensorShape post_op_arg_shape(1, 1,
batch);
544 TensorInfo post_op_arg_info(post_op_arg_shape, 1,
data_type);
545 experimental::PostOpList<ITensorInfo*>
post_ops{};
553 const unsigned int m = 22;
554 const unsigned int n = 16;
555 const unsigned int k = 15;
556 const unsigned int batch = 3;
557 TensorShape post_op_arg_shape(1, 1, 1);
558 TensorInfo post_op_arg_info(post_op_arg_shape, 1,
data_type);
559 experimental::PostOpList<ITensorInfo*>
post_ops{};
578 v0_values_precommit),
579 h0_values_precommit),
582 framework::dataset::
make("export_to_cl_image_rhs", false)),
585 beta_values_precommit),
586 broadcast_bias_values),
587 lhs_transpose_values),
618 beta_values_nightly),
619 broadcast_bias_values),
620 lhs_transpose_values),
645 v0_values_precommit),
646 h0_values_precommit),
652 beta_values_precommit),
653 lhs_transpose_values),
685 beta_values_nightly),
686 lhs_transpose_values),
711 v0_values_precommit),
712 h0_values_precommit),
713 framework::dataset::
make("interleave_lhs", {
false })),
718 beta_values_precommit),
720 lhs_transpose_values),
741 framework::dataset::
make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1,
DataType::F32),
771 GEMMLHSMatrixInfo(4, 4, 1,
false,
true),
772 GEMMLHSMatrixInfo(4, 8, 1,
false,
true),
773 GEMMLHSMatrixInfo(4, 4, 1,
false,
true),
774 GEMMLHSMatrixInfo(4, 2, 1,
false,
false),
775 GEMMLHSMatrixInfo(4, 4, 1,
false,
false),
779 GEMMRHSMatrixInfo(4, 4, 1,
true,
true,
true),
780 GEMMRHSMatrixInfo(4, 8, 1,
true,
true,
true),
781 GEMMRHSMatrixInfo(8, 4, 1,
true,
true,
true),
782 GEMMRHSMatrixInfo(4, 2, 1,
true,
false,
true),
783 GEMMRHSMatrixInfo(2, 4, 1,
true,
false,
true),
792 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
806 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
820 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
835 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
849 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
867 &
output_info.clone()->set_is_resizable(
true),1.f,1.f,
882 v0_values_precommit),
883 h0_values_precommit),
889 beta_values_precommit),
890 broadcast_bias_values),
891 lhs_transpose_values),
914 n0_export_to_cl_image_values_nightly),
915 k0_export_to_cl_image_values_nightly),
923 beta_values_nightly),
924 broadcast_bias_values),
925 lhs_transpose_values),
950 v0_values_precommit),
951 h0_values_precommit),
957 beta_values_precommit),
958 lhs_transpose_values),
981 n0_export_to_cl_image_values_nightly),
982 k0_export_to_cl_image_values_nightly),
990 beta_values_nightly),
991 lhs_transpose_values),
1016 v0_values_precommit),
1017 h0_values_precommit),
1018 framework::dataset::
make("interleave_lhs", {
false })),
1022 a_values_precommit),
1023 beta_values_precommit),
1025 lhs_transpose_values),
1058 v0_values_precommit),
1059 h0_values_precommit),
1062 framework::dataset::
make("export_to_cl_image_rhs", false)),
1064 a_values_precommit),
1065 beta_values_precommit),
1066 broadcast_bias_values),
1067 lhs_transpose_values),
1073 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1098 beta_values_nightly),
1099 broadcast_bias_values),
1100 lhs_transpose_values),
1106 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1125 v0_values_precommit),
1126 h0_values_precommit),
1131 a_values_precommit),
1132 beta_values_precommit),
1133 lhs_transpose_values),
1139 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1165 beta_values_nightly),
1166 lhs_transpose_values),
1172 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1192 v0_values_precommit),
1193 h0_values_precommit),
1194 framework::dataset::
make("interleave_lhs", {
false })),
1198 a_values_precommit),
1199 beta_values_precommit),
1201 lhs_transpose_values),
1209 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1222 framework::dataset::
make("Input0Info", { TensorInfo(TensorShape(256U, 16U, 2U), 1,
DataType::F16),
1252 GEMMLHSMatrixInfo(4, 4, 1,
false,
true),
1253 GEMMLHSMatrixInfo(4, 8, 1,
false,
true),
1254 GEMMLHSMatrixInfo(4, 4, 1,
false,
true),
1255 GEMMLHSMatrixInfo(4, 2, 1,
false,
false),
1256 GEMMLHSMatrixInfo(4, 4, 1,
false,
false),
1260 GEMMRHSMatrixInfo(4, 4, 1,
true,
true,
true),
1261 GEMMRHSMatrixInfo(4, 8, 1,
true,
true,
true),
1262 GEMMRHSMatrixInfo(8, 4, 1,
true,
true,
true),
1263 GEMMRHSMatrixInfo(4, 2, 1,
true,
false,
true),
1264 GEMMRHSMatrixInfo(2, 4, 1,
true,
false,
true),
1273 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1276 GEMMLHSMatrixInfo(),
1277 GEMMRHSMatrixInfo(),
1280 GEMMKernelInfo( 64 ,
1287 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1290 GEMMLHSMatrixInfo(),
1291 GEMMRHSMatrixInfo(),
1294 GEMMKernelInfo( 64 ,
1301 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1304 GEMMLHSMatrixInfo(),
1305 GEMMRHSMatrixInfo(),
1309 GEMMKernelInfo( 64 ,
1316 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1319 GEMMLHSMatrixInfo(),
1320 GEMMRHSMatrixInfo(),
1323 GEMMKernelInfo( 64 ,
1330 ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU,
1333 GEMMLHSMatrixInfo(),
1334 GEMMRHSMatrixInfo(),
1348 &
output_info.clone()->set_is_resizable(
true),1.f,1.f,
1363 v0_values_precommit),
1364 h0_values_precommit),
1369 a_values_precommit),
1370 beta_values_precommit),
1371 broadcast_bias_values),
1372 lhs_transpose_values),
1378 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1395 n0_export_to_cl_image_values_nightly),
1396 k0_export_to_cl_image_values_nightly),
1404 beta_values_nightly),
1405 broadcast_bias_values),
1406 lhs_transpose_values),
1412 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1431 v0_values_precommit),
1432 h0_values_precommit),
1437 a_values_precommit),
1438 beta_values_precommit),
1439 lhs_transpose_values),
1445 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1462 n0_export_to_cl_image_values_nightly),
1463 k0_export_to_cl_image_values_nightly),
1471 beta_values_nightly),
1472 lhs_transpose_values),
1478 validate(
CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1497 v0_values_precommit),
1498 h0_values_precommit),
1499 framework::dataset::
make("interleave_lhs", {
false })),
1503 a_values_precommit),
1504 beta_values_precommit),
1506 lhs_transpose_values),
1514 validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16);
1539 v0_values_precommit),
1540 h0_values_precommit),
1543 framework::dataset::
make("export_to_cl_image_rhs", false)),
1545 a_values_precommit),
1546 beta_values_precommit),
1547 broadcast_bias_values),
1548 lhs_transpose_values),
1554 validate(
CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1579 beta_values_nightly),
1580 broadcast_bias_values),
1581 lhs_transpose_values),
1587 validate(
CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1606 v0_values_precommit),
1607 h0_values_precommit),
1612 a_values_precommit),
1613 beta_values_precommit),
1614 lhs_transpose_values),
1620 validate(
CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1646 beta_values_nightly),
1647 lhs_transpose_values),
1653 validate(
CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);
1673 v0_values_precommit),
1674 h0_values_precommit),
1675 framework::dataset::
make("interleave_lhs", {
false })),
1679 a_values_precommit),
1680 beta_values_precommit),
1682 lhs_transpose_values),
1690 validate(CLAccessor(_target), _reference, rel_tolerance_f16_mixed_precision, 0.f, abs_tolerance_f16_mixed_precision);