Add quantized CL MatMul kernels for Lhs NT/T, Rhs NT
Implement OpenCL kernels for batched Matrix Multiplication for the quantized data types QASYMM8 and QASYMM8_SIGNED.
Quantized MatMul is supported with the following MatMul attributes:
* adj_x = false, adj_y = false
* adj_x = true, adj_y = false
We consider native format kernels only. In other words, no reshaping of the operand matrices is done.
Resolves: COMPMID-5921, COMPMID-5922
Change-Id: I99e0f68054a2bd635c60ec2641acc2e7ff398473
Signed-off-by: Omar Al Khatib <omar.alkhatib@arm.com>
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Signed-off-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9435
Reviewed-by: SiCong Li <sicong.li@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
diff --git a/tests/validation/CL/MatMulKernel.cpp b/tests/validation/CL/MatMulKernel.cpp
index 9c19e42..ff872aa 100644
--- a/tests/validation/CL/MatMulKernel.cpp
+++ b/tests/validation/CL/MatMulKernel.cpp
@@ -73,7 +73,7 @@
const auto k0_values_nightly_lhs_t_rhs_nt = framework::dataset::make("K0", { 1, 2, 3, 4, 5, 6, 7, 8 });
template <typename T>
-using CLMatMulKernelFixture = MatMulKernelValidationFixture<T>;
+using CLMatMulKernelFixture = MatMulKernelValidationFixture<T, ClMatMulNativeKernel>;
TEST_SUITE(CL)
TEST_SUITE(MatMulKernel)
@@ -95,8 +95,8 @@
{ MatMulKernelInfo(false, false, 9, 1, 2), true },
{ MatMulKernelInfo(false, false, 3, 16, 3), true },
{ MatMulKernelInfo(false, false, 7, 3, 4), true },
- { MatMulKernelInfo(false, false, 7, 3, 4, true), false }, // N0 not in {4, 8, 16}
- { MatMulKernelInfo(false, false, 7, 1, 4, true), false }, // N0 not in {4, 8, 16}
+ { MatMulKernelInfo(false, false, 7, 3, 4, true), false }, // N0 not in {4, 8, 16}
+ { MatMulKernelInfo(false, false, 7, 1, 4, true), false }, // N0 not in {4, 8, 16}
{ MatMulKernelInfo(false, false, 7, 12, 4, true), false }, // N0 not in {4, 8, 16}
{ MatMulKernelInfo(false, false, 7, 4, 4, true), true },
{ MatMulKernelInfo(false, false, 7, 8, 4, true), true },
@@ -166,7 +166,7 @@
if(!pair.first.export_rhs_to_cl_image || export_to_cl_image_supported)
{
- ARM_COMPUTE_EXPECT(bool(status) == pair.second, framework::LogLevel::ERRORS);
+ ARM_COMPUTE_EXPECT(bool(status) == pair.second, framework::LogLevel::ERRORS);
}
}
}
@@ -176,9 +176,9 @@
// We skip this test if the hardware does not support exporting to CL Image
if(image2d_from_buffer_supported(CLKernelLibrary::get().get_device()))
{
- constexpr size_t pixel_size = 4;
- const size_t max_image_w = pixel_size * CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_WIDTH>();
- const size_t max_image_h = CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_HEIGHT>();
+ constexpr size_t pixel_size = 4;
+ const size_t max_image_w = pixel_size * CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_WIDTH>();
+ const size_t max_image_h = CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_HEIGHT>();
using ShapeConfigurationTuple = std::tuple<TensorShape, TensorShape, bool, bool, bool>;
const std::vector<ShapeConfigurationTuple> shape_configurations =
@@ -186,18 +186,18 @@
// lhs_shape, rhs_shape, adj_lhs, adj_rhs, expected
// Lhs t/Nt, Rhs Nt
// Transposition of Lhs doesn't add any value to the tests, therefore always assumed false below
- { TensorShape(5U, 1U), TensorShape(3U, 5U), false, false, false }, // N should be multiple of 4
+ { TensorShape(5U, 1U), TensorShape(3U, 5U), false, false, false }, // N should be multiple of 4
{ TensorShape(5U, 1U), TensorShape(14U, 5U), false, false, false }, // N should be multiple of 4
{ TensorShape(5U, 1U), TensorShape(12U, 5U), false, false, true },
{ TensorShape(5U, 1U), TensorShape(8U, 5U), false, false, true },
{ TensorShape(5U, 1U), TensorShape(4U, 5U), false, false, true },
{ TensorShape(max_image_h + 1, 1U), TensorShape(4U, max_image_h + 1), false, false, false }, // Cannot fit into CL Image memory's height
- { TensorShape(5U, 1U), TensorShape(max_image_w + 1, 5U), false, false, false }, // Cannot fit into CL Image memory's width
- { TensorShape(max_image_h, 1U), TensorShape(4U, max_image_h), false, false, true }, // Barely fits into CL Image memory's height
- { TensorShape(5U, 1U), TensorShape(max_image_w, 5U), false, false, true }, // Barely fits into CL Image memory's width
+ { TensorShape(5U, 1U), TensorShape(max_image_w + 1, 5U), false, false, false }, // Cannot fit into CL Image memory's width
+ { TensorShape(max_image_h, 1U), TensorShape(4U, max_image_h), false, false, true }, // Barely fits into CL Image memory's height
+ { TensorShape(5U, 1U), TensorShape(max_image_w, 5U), false, false, true }, // Barely fits into CL Image memory's width
// Lhs Nt/T , Rhs T
- { TensorShape(5U, 1U), TensorShape(5U, 3U), false, true, false }, // K should be multiple of 4
+ { TensorShape(5U, 1U), TensorShape(5U, 3U), false, true, false }, // K should be multiple of 4
{ TensorShape(5U, 1U), TensorShape(5U, 14U), false, true, false }, // K should be multiple of 4
{ TensorShape(4U, 1U), TensorShape(4U, 10U), false, true, true },
{ TensorShape(8U, 1U), TensorShape(8U, 9U), false, true, true },
@@ -216,7 +216,10 @@
const bool adj_rhs = std::get<3>(tuple);
// We choose M0, N0, K0 equal to 4 so that they're always valid for CLImage in any combination
- const MatMulKernelInfo matmul_kernel_info {adj_lhs, adj_rhs, 4, 4, 4, true /* export_rhs_to_cl_image */};
+ const MatMulKernelInfo matmul_kernel_info
+ {
+ adj_lhs, adj_rhs, 4, 4, 4, true /* export_rhs_to_cl_image */
+ };
TensorInfo output_info;
Status status = ClMatMulNativeKernel::validate(&lhs_info, &rhs_info, &output_info, matmul_kernel_info);
@@ -330,60 +333,60 @@
TEST_SUITE(FP32)
TEST_SUITE(Buffer)
FIXTURE_DATA_TEST_CASE(RunTiny, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::TinyMatMulDataset(),
- framework::dataset::make("pretransose_A", { false, true })),
- framework::dataset::make("pretransose_B", { false, true })),
- m0_values_precommit),
- n0_values_precommit),
- k0_values_precommit),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
- framework::dataset::make("DataType", DataType::F32)))
+ framework::dataset::make("TransposeA", { false, true })),
+ framework::dataset::make("TransposeB", { false, true })),
+ m0_values_precommit),
+ n0_values_precommit),
+ k0_values_precommit),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
FIXTURE_DATA_TEST_CASE(RunSmall, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDataset(),
- framework::dataset::make("pretransose_A", { false, true })),
- framework::dataset::make("pretransose_B", { false, true })),
- m0_values_precommit),
- n0_values_precommit),
- k0_values_precommit),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
- framework::dataset::make("DataType", DataType::F32)))
+ framework::dataset::make("TransposeA", { false, true })),
+ framework::dataset::make("TransposeB", { false, true })),
+ m0_values_precommit),
+ n0_values_precommit),
+ k0_values_precommit),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
FIXTURE_DATA_TEST_CASE(RunLargeNoTranspose, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { false })),
- framework::dataset::make("pretransose_B", { false })),
+ framework::dataset::make("TransposeA", { false })),
+ framework::dataset::make("TransposeB", { false })),
m0_values_nightly_lhs_nt),
n0_values_nightly_rhs_nt),
k0_values_nightly_lhs_nt_rhs_nt),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { false })),
- framework::dataset::make("pretransose_B", { true })),
+ framework::dataset::make("TransposeA", { false })),
+ framework::dataset::make("TransposeB", { true })),
m0_values_nightly_lhs_nt),
n0_values_nightly_rhs_t),
k0_values_nightly_rhs_t),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { true })),
- framework::dataset::make("pretransose_B", { false })),
+ framework::dataset::make("TransposeA", { true })),
+ framework::dataset::make("TransposeB", { false })),
m0_values_nightly_lhs_t),
n0_values_nightly_rhs_nt),
k0_values_nightly_lhs_t_rhs_nt),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
@@ -391,12 +394,12 @@
}
FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposedRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY,
combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { true })),
- framework::dataset::make("pretransose_B", { true })),
- m0_values_nightly_lhs_t),
- n0_values_nightly_rhs_t),
- k0_values_nightly_rhs_t),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("TransposeA", { true })),
+ framework::dataset::make("TransposeB", { true })),
+ m0_values_nightly_lhs_t),
+ n0_values_nightly_rhs_t),
+ k0_values_nightly_rhs_t),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
@@ -405,13 +408,13 @@
// Running High Dimensional test is enough for FP32, because we're stressing the number of dimensions, not data type or M0/N0/K0
// It's a good idea to test for each Lhs/Rhs T/NT combinations because they're different CL kernels
FIXTURE_DATA_TEST_CASE(RunHighDimensional, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::HighDimensionalMatMulDataset(),
- framework::dataset::make("pretransose_A", { false, true })),
- framework::dataset::make("pretransose_B", { false, true })),
- framework::dataset::make("M0", { 2 })),
- framework::dataset::make("N0", { 2 })),
- framework::dataset::make("K0", { 2 })),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
- framework::dataset::make("DataType", DataType::F32)))
+ framework::dataset::make("TransposeA", { false, true })),
+ framework::dataset::make("TransposeB", { false, true })),
+ framework::dataset::make("M0", { 2 })),
+ framework::dataset::make("N0", { 2 })),
+ framework::dataset::make("K0", { 2 })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
@@ -419,14 +422,15 @@
TEST_SUITE_END() // Buffer
TEST_SUITE(ExportRhsToCLImage)
-FIXTURE_DATA_TEST_CASE(RunSmallRhsNotTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsNT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { false })),
- framework::dataset::make("M0", { 2 })),
- framework::dataset::make("N0", { 4, 8, 16 })),
- framework::dataset::make("K0", { 2, 4 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F32)))
+FIXTURE_DATA_TEST_CASE(RunSmallRhsNotTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL,
+ combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsNT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { false })),
+ framework::dataset::make("M0", { 2 })),
+ framework::dataset::make("N0", { 4, 8, 16 })),
+ framework::dataset::make("K0", { 2, 4 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -434,14 +438,15 @@
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
}
-FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsNT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { false })),
- framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
- framework::dataset::make("N0", { 4, 8, 16 })),
- framework::dataset::make("K0", { 1, 2, 3, 4 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F32)))
+FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY,
+ combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsNT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { false })),
+ framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
+ framework::dataset::make("N0", { 4, 8, 16 })),
+ framework::dataset::make("K0", { 1, 2, 3, 4 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -449,14 +454,15 @@
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
}
-FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { true })),
- framework::dataset::make("M0", { 2 })),
- framework::dataset::make("N0", { 2, 4 })),
- framework::dataset::make("K0", { 4, 8, 16 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F32)))
+FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::ALL,
+ combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { true })),
+ framework::dataset::make("M0", { 2 })),
+ framework::dataset::make("N0", { 2, 4 })),
+ framework::dataset::make("K0", { 4, 8, 16 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -464,14 +470,15 @@
validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32);
}
}
-FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { true })),
- framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
- framework::dataset::make("N0", { 1, 2, 3, 4 })),
- framework::dataset::make("K0", { 4, 8, 16 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F32)))
+FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<float>, framework::DatasetMode::NIGHTLY,
+ combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { true })),
+ framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
+ framework::dataset::make("N0", { 1, 2, 3, 4 })),
+ framework::dataset::make("K0", { 4, 8, 16 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F32)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -485,61 +492,62 @@
TEST_SUITE(FP16)
TEST_SUITE(Buffer)
FIXTURE_DATA_TEST_CASE(RunSmall, CLMatMulKernelFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDataset(),
- framework::dataset::make("pretransose_A", { false, true })),
- framework::dataset::make("pretransose_B", { false, true })),
- m0_values_precommit),
- n0_values_precommit),
- k0_values_precommit),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
- framework::dataset::make("DataType", DataType::F16)))
+ framework::dataset::make("TransposeA", { false, true })),
+ framework::dataset::make("TransposeB", { false, true })),
+ m0_values_precommit),
+ n0_values_precommit),
+ k0_values_precommit),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
FIXTURE_DATA_TEST_CASE(RunLargeNoTranspose, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { false })),
- framework::dataset::make("pretransose_B", { false })),
+ framework::dataset::make("TransposeA", { false })),
+ framework::dataset::make("TransposeB", { false })),
m0_values_nightly_lhs_nt),
n0_values_nightly_rhs_nt),
k0_values_nightly_lhs_nt_rhs_nt),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { false })),
- framework::dataset::make("pretransose_B", { true })),
+ framework::dataset::make("TransposeA", { false })),
+ framework::dataset::make("TransposeB", { true })),
m0_values_nightly_lhs_nt),
n0_values_nightly_rhs_t),
k0_values_nightly_rhs_t),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { true })),
- framework::dataset::make("pretransose_B", { false })),
+ framework::dataset::make("TransposeA", { true })),
+ framework::dataset::make("TransposeB", { false })),
m0_values_nightly_lhs_t),
n0_values_nightly_rhs_nt),
k0_values_nightly_lhs_t_rhs_nt),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
-FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposedRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
- framework::dataset::make("pretransose_A", { true })),
- framework::dataset::make("pretransose_B", { true })),
- m0_values_nightly_lhs_t),
- n0_values_nightly_rhs_t),
- k0_values_nightly_rhs_t),
- framework::dataset::make("export_rhs_to_cl_image", { false })),
- framework::dataset::make("DataType", DataType::F16)))
+FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposedRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY,
+ combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDataset(),
+ framework::dataset::make("TransposeA", { true })),
+ framework::dataset::make("TransposeB", { true })),
+ m0_values_nightly_lhs_t),
+ n0_values_nightly_rhs_t),
+ k0_values_nightly_rhs_t),
+ framework::dataset::make("ExportRhsToCLImage", { false })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
@@ -547,14 +555,15 @@
TEST_SUITE_END() // Buffer
TEST_SUITE(ExportRhsToCLImage)
-FIXTURE_DATA_TEST_CASE(RunSmallRhsNotTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsNT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { false })),
- framework::dataset::make("M0", { 2 })),
- framework::dataset::make("N0", { 4, 8, 16 })),
- framework::dataset::make("K0", { 2, 4 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F16)))
+FIXTURE_DATA_TEST_CASE(RunSmallRhsNotTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::ALL,
+ combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsNT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { false })),
+ framework::dataset::make("M0", { 2 })),
+ framework::dataset::make("N0", { 4, 8, 16 })),
+ framework::dataset::make("K0", { 2, 4 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -562,14 +571,15 @@
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
}
-FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsNT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { false })),
- framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
- framework::dataset::make("N0", { 4, 8, 16 })),
- framework::dataset::make("K0", { 1, 2, 3, 4 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F16)))
+FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY,
+ combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsNT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { false })),
+ framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
+ framework::dataset::make("N0", { 4, 8, 16 })),
+ framework::dataset::make("K0", { 1, 2, 3, 4 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -577,14 +587,15 @@
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
}
-FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { true })),
- framework::dataset::make("M0", { 2 })),
- framework::dataset::make("N0", { 2, 4 })),
- framework::dataset::make("K0", { 4, 8, 16 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F16)))
+FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::ALL,
+ combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { true })),
+ framework::dataset::make("M0", { 2 })),
+ framework::dataset::make("N0", { 2, 4 })),
+ framework::dataset::make("K0", { 4, 8, 16 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
if(_device_supports_export_to_cl_image)
@@ -592,14 +603,15 @@
validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16);
}
}
-FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsT(),
- framework::dataset::make("pretransose_A", { true, false })),
- framework::dataset::make("pretransose_B", { true })),
- framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
- framework::dataset::make("N0", { 1, 2, 3, 4 })),
- framework::dataset::make("K0", { 4, 8, 16 })),
- framework::dataset::make("export_rhs_to_cl_image", { true })),
- framework::dataset::make("DataType", DataType::F16)))
+FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture<half>, framework::DatasetMode::NIGHTLY,
+ combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsT(),
+ framework::dataset::make("TransposeA", { true, false })),
+ framework::dataset::make("TransposeB", { true })),
+ framework::dataset::make("M0", { 2 })), // Choices of M0 does not matter much because it's related to Lhs tensor
+ framework::dataset::make("N0", { 1, 2, 3, 4 })),
+ framework::dataset::make("K0", { 4, 8, 16 })),
+ framework::dataset::make("ExportRhsToCLImage", { true })),
+ framework::dataset::make("DataType", DataType::F16)))
{
// Validate output
if(_device_supports_export_to_cl_image)