From b531b7549abdd5c10b14b00107ea647591baa430 Mon Sep 17 00:00:00 2001 From: Ramy Elgammal Date: Mon, 20 Mar 2023 10:19:10 +0000 Subject: Add Texture Pipe Support for Matmul Lhs T/NT Rhs T kernels Resolves: COMPMID-5952, COMPMID-5956 Change-Id: Idbd14538e7660792254072fa9631a6f03966f89b Signed-off-by: Ramy Elgammal Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9371 Comments-Addressed: Arm Jenkins Reviewed-by: Gunes Bayir Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- src/core/CL/cl_kernels/common/mat_mul.cl | 29 +++++------ tests/datasets/LargeMatMulDataset.h | 12 ++++- tests/datasets/SmallMatMulDataset.h | 12 +++++ tests/validation/CL/MatMulKernel.cpp | 89 ++++++++++++++++++++++++++++++-- 4 files changed, 121 insertions(+), 21 deletions(-) diff --git a/src/core/CL/cl_kernels/common/mat_mul.cl b/src/core/CL/cl_kernels/common/mat_mul.cl index 90ebf80a6a..90d485e815 100644 --- a/src/core/CL/cl_kernels/common/mat_mul.cl +++ b/src/core/CL/cl_kernels/common/mat_mul.cl @@ -160,11 +160,12 @@ __kernel void mat_mul_native_nt_nt( * @note The block's dimensions used for the LHS and RHS matrices (M0, N0 and K0) must be passed at compile time using -DN0, -DM0 and -DK0 (e.g. -DN0=8, -DM0=4, -DK0=4). * @note The number of leftover outputs rows/columns must be passed using -DPARTIAL_STORE_N0 and -DPARTIAL_STORE_M0 (e.g. -DPARTIAL_STORE_N0=2, -DPARTIAL_STORE_M0=3) * @note The dimension K must be passed at compile time using -DK (e.g. -DK=6) + * @note The tensor type ("BUFFER" or "IMAGE") of the rhs tensor must be passed at compile time using -DRHS_TENSOR_TYPE (e.g. -DRHS_TENSOR_TYPE=BUFFER) * @note The kernel name in uppercase must be passed at compile time (e.g. -DMAT_MUL_NATIVE_NT_T) * @note Only the following configurations of M0, N0 and K0 are currently supported: * - M0 > 0 * - N0 = 1, 2, 3, 4, 8, 16 - * - K0 = 1, 2, 3, 4, 8, 16 + * - K0 = 1, 2, 3, 4, 8, 16 (only 4, 8, 16 if RHS_TENSOR_TYPE=IMAGE) * @note Values > 8 for M0, N0 and K0 are not expected to be efficient * * @param[in] lhs_ptr Pointer to the lhs matrix. Supported data types: F32/F16 @@ -174,6 +175,7 @@ __kernel void mat_mul_native_nt_nt( * @param[in] lhs_h The height of the lhs tensor * @param[in] lhs_n Number of the matrices (buffers) in the batch * @param[in] lhs_offset_first_element_in_bytes The offset of the first element in the lhs matrix + * @param[in] rhs_img (Optional) Read only cl_image object for the rhs tensor. Included when RHS_TENSOR_TYPE=IMAGE * @param[in] rhs_ptr Pointer to the rhs matrix. Supported data types: same as @p lhs_ptr * @param[in] rhs_stride_y Stride of the rhs matrix in Y (2nd) dimension (in bytes) * @param[in] rhs_stride_z Stride of the rhs tensor in Z (3rd) dimension (in bytes) @@ -190,7 +192,7 @@ __kernel void mat_mul_native_nt_nt( * @param[in] dst_offset_first_element_in_bytes The offset of the first element in the dst matrix */ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), - TENSOR3D_T(rhs, BUFFER), + TENSOR3D_T(rhs, RHS_TENSOR_TYPE), TENSOR3D_T(dst, BUFFER)) { @@ -200,7 +202,6 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), // Compute LHS/RHS/DST matrix address lhs_offset_first_element_in_bytes += y * lhs_stride_y + z * lhs_stride_z; - rhs_offset_first_element_in_bytes += x * rhs_stride_y + z * rhs_stride_z; dst_offset_first_element_in_bytes += x * sizeof(DATA_TYPE) + y * dst_stride_y + z * dst_stride_z; // Initialize the accumulators @@ -211,6 +212,7 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), acc[i].v = 0.f; }) + const int rhs_z = z * rhs_h; int k; for(k = 0; k <= K - K0; k += K0) { @@ -229,7 +231,7 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), // Load tile from the lhs/rhs tensors T_LOAD(DATA_TYPE, M0, K0, BUFFER, lhs, 0, 0, 1, lhs_stride_y, a); - T_LOAD(DATA_TYPE, N0, K0, BUFFER, rhs, 0, 0, 1, rhs_stride_y, b); + T_LOAD(DATA_TYPE, N0, K0, RHS_TENSOR_TYPE, rhs, k, x + rhs_z, 1, rhs_stride_y, b); #if GPU_ARCH == GPU_ARCH_MIDGARD // This part is written to decrease the number of loop unrollings caused @@ -251,7 +253,6 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), #endif // GPU_ARCH == GPU_ARCH_MIDGARD lhs_offset_first_element_in_bytes += K0 * sizeof(DATA_TYPE); - rhs_offset_first_element_in_bytes += K0 * sizeof(DATA_TYPE); } #if K % K0 != 0 @@ -273,7 +274,7 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), // Load tile from the lhs/rhs tensors T_LOAD(DATA_TYPE, M0, 1, BUFFER, lhs, 0, 0, 1, lhs_stride_y, a); - T_LOAD(DATA_TYPE, N0, 1, BUFFER, rhs, 0, 0, 1, rhs_stride_y, b); + T_LOAD(DATA_TYPE, N0, 1, BUFFER, rhs, k, x + rhs_z, 1, rhs_stride_y, b); #if GPU_ARCH == GPU_ARCH_MIDGARD // See the main loop for the explanation of this part @@ -288,7 +289,6 @@ __kernel void mat_mul_native_nt_t(TENSOR3D_T(lhs, BUFFER), #endif // GPU_ARCH == GPU_ARCH_MIDGARD lhs_offset_first_element_in_bytes += 1 * sizeof(DATA_TYPE); - rhs_offset_first_element_in_bytes += 1 * sizeof(DATA_TYPE); } #endif // K % K0 != 0 @@ -464,11 +464,12 @@ __kernel void mat_mul_native_t_nt( * @note The block's dimensions used for the LHS and RHS matrices (M0, N0 and K0) must be passed at compile time using -DN0, -DM0 and -DK0 (e.g. -DN0=8, -DM0=4, -DK0=4). * @note The number of leftover outputs rows/columns must be passed using -DPARTIAL_STORE_N0 and -DPARTIAL_STORE_M0 (e.g. -DPARTIAL_STORE_N0=2, -DPARTIAL_STORE_M0=3) * @note The dimension K must be passed at compile time using -DK (e.g. -DK=6) + * @note The tensor type ("BUFFER" or "IMAGE") of the rhs tensor must be passed at compile time using -DRHS_TENSOR_TYPE (e.g. -DRHS_TENSOR_TYPE=BUFFER) * @note The kernel name in uppercase must be passed at compile time (e.g. -DMAT_MUL_NATIVE_T_NT) * @note Only the following configurations of M0, N0 and K0 are currently supported: * - M0 = 1, 2, 3, 4, 8, 16 * - N0 = 1, 2, 3, 4, 8, 16 - * - K0 = 1, 2, 3, 4, 8, 16 + * - K0 = 1, 2, 3, 4, 8, 16 (only 4, 8, 16 if RHS_TENSOR_TYPE=IMAGE) * @note Values > 8 for M0, N0 and K0 are not expected to be efficient * * @param[in] lhs_ptr Pointer to the lhs matrix. Supported data types: F32/F16 @@ -478,6 +479,7 @@ __kernel void mat_mul_native_t_nt( * @param[in] lhs_h The height of the lhs tensor * @param[in] lhs_n Number of the matrices (buffers) in the batch * @param[in] lhs_offset_first_element_in_bytes The offset of the first element in the lhs matrix + * @param[in] rhs_img (Optional) Read only cl_image object for the rhs tensor. Included when RHS_TENSOR_TYPE=IMAGE * @param[in] rhs_ptr Pointer to the rhs matrix. Supported data types: same as @p lhs_ptr * @param[in] rhs_stride_y Stride of the rhs matrix in Y (2nd) dimension (in bytes) * @param[in] rhs_stride_z Stride of the rhs tensor in Z (3rd) dimension (in bytes) @@ -495,7 +497,7 @@ __kernel void mat_mul_native_t_nt( */ __kernel void mat_mul_native_t_t( TENSOR3D_T(lhs, BUFFER), - TENSOR3D_T(rhs, BUFFER), + TENSOR3D_T(rhs, RHS_TENSOR_TYPE), TENSOR3D_T(dst, BUFFER)) { const uint x = GET_SPATIAL_IDX(0, N0, PARTIAL_STORE_N0); @@ -504,7 +506,6 @@ __kernel void mat_mul_native_t_t( // Compute LHS/RHS/DST matrix address lhs_offset_first_element_in_bytes += y * sizeof(DATA_TYPE) + z * lhs_stride_z; - rhs_offset_first_element_in_bytes += x * rhs_stride_y + z * rhs_stride_z; dst_offset_first_element_in_bytes += x * sizeof(DATA_TYPE) + y * dst_stride_y + z * dst_stride_z; // Initialize the accumulators @@ -515,6 +516,7 @@ __kernel void mat_mul_native_t_t( acc[i].v = 0.f; }) + const int rhs_z = z * rhs_h; int k; for(k = 0; k <= K - K0; k += K0) { @@ -533,8 +535,7 @@ __kernel void mat_mul_native_t_t( // Load tile from the lhs/rhs tensors T_LOAD(DATA_TYPE, K0, M0, BUFFER, lhs, 0, 0, 1, lhs_stride_y, a); - T_LOAD(DATA_TYPE, N0, K0, BUFFER, rhs, 0, 0, 1, rhs_stride_y, b); - + T_LOAD(DATA_TYPE, N0, K0, RHS_TENSOR_TYPE, rhs, k, x + rhs_z, 1, rhs_stride_y, b); #if GPU_ARCH == GPU_ARCH_MIDGARD // For explanation, see mat_mul_native_nt_t TILE(DATA_TYPE, M0, K0, at); @@ -562,7 +563,6 @@ __kernel void mat_mul_native_t_t( #endif // GPU_ARCH == GPU_ARCH_MIDGARD lhs_offset_first_element_in_bytes += K0 * lhs_stride_y; - rhs_offset_first_element_in_bytes += K0 * sizeof(DATA_TYPE); } #ifdef K % K0 != 0 @@ -584,7 +584,7 @@ __kernel void mat_mul_native_t_t( // Load tile from the lhs/rhs tensors T_LOAD(DATA_TYPE, 1, M0, BUFFER, lhs, 0, 0, 1, lhs_stride_y, a); - T_LOAD(DATA_TYPE, N0, 1, BUFFER, rhs, 0, 0, 1, rhs_stride_y, b); + T_LOAD(DATA_TYPE, N0, 1, BUFFER, rhs, k, x + rhs_z, 1, rhs_stride_y, b); #if GPU_ARCH == GPU_ARCH_MIDGARD // For explanation, see mat_mul_native_nt_t @@ -607,7 +607,6 @@ __kernel void mat_mul_native_t_t( #endif // GPU_ARCH == GPU_ARCH_MIDGARD lhs_offset_first_element_in_bytes += 1 * lhs_stride_y; - rhs_offset_first_element_in_bytes += 1 * sizeof(DATA_TYPE); } #endif // K % K0 != 0 diff --git a/tests/datasets/LargeMatMulDataset.h b/tests/datasets/LargeMatMulDataset.h index b5181bc30b..8f6c000d37 100644 --- a/tests/datasets/LargeMatMulDataset.h +++ b/tests/datasets/LargeMatMulDataset.h @@ -65,7 +65,17 @@ public: add_config(TensorShape(45U, 38U, 3U, 2U, 3U), TensorShape(20U, 45U, 3U, 2U, 3U), TensorShape(20U, 38U, 3U, 2U, 3U)); } }; - +class LargeMatMulDatasetRhsExportToCLImageRhsT final : public MatMulDataset +{ +public: + // For shape choices, please refer to the explanations given in SmallMatMulDatasetRhsExportToCLImageRhsT + LargeMatMulDatasetRhsExportToCLImageRhsT() + { + add_config(TensorShape(28U, 13U, 3U, 2U), TensorShape(32U, 28U, 3U, 2U), TensorShape(32U, 13U, 3U, 2U)); + add_config(TensorShape(40U, 12U, 1U, 5U, 2U), TensorShape(20U, 40U, 1U, 5U, 2U), TensorShape(20U, 12U, 1U, 5U, 2U)); + add_config(TensorShape(44U, 38U, 3U, 2U, 3U), TensorShape(20U, 44U, 3U, 2U, 3U), TensorShape(20U, 38U, 3U, 2U, 3U)); + } +}; } // namespace datasets } // namespace test } // namespace arm_compute diff --git a/tests/datasets/SmallMatMulDataset.h b/tests/datasets/SmallMatMulDataset.h index 93e5f7dc2c..52ef01da7b 100644 --- a/tests/datasets/SmallMatMulDataset.h +++ b/tests/datasets/SmallMatMulDataset.h @@ -57,6 +57,18 @@ public: } }; +class SmallMatMulDatasetRhsExportToCLImageRhsT final : public MatMulDataset +{ +public: + // Some considerations: + // 1) K dimension should be a multiple of 4 + // See (2), (3), and (4) in SmallMatMulDatasetRhsExportToCLImageRhsNT + SmallMatMulDatasetRhsExportToCLImageRhsT() + { + add_config(TensorShape(8U /*K*/, 3U /*M*/, 2U, 1U, 2U), TensorShape(20U /*N*/, 8U /*K*/, 2U, 1U, 2U), TensorShape(20U /*N*/, 3U /*M*/, 2U, 1U, 2U)); + } +}; + class SmallMatMulDatasetRhsExportToCLImageRhsNT final : public MatMulDataset { public: diff --git a/tests/validation/CL/MatMulKernel.cpp b/tests/validation/CL/MatMulKernel.cpp index 59af8dba45..962542400e 100644 --- a/tests/validation/CL/MatMulKernel.cpp +++ b/tests/validation/CL/MatMulKernel.cpp @@ -111,8 +111,14 @@ TEST_CASE(SupportedBlockSizes, framework::DatasetMode::ALL) { MatMulKernelInfo(false, true, 5, 1, 2), true }, { MatMulKernelInfo(false, true, 3, 3, 3), true }, { MatMulKernelInfo(false, true, 2, 4, 8), true }, - - // // Lhs transposed, Rhs-not-transposed + { MatMulKernelInfo(false, true, 2, 4, 5, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(false, true, 2, 4, 9, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(false, true, 2, 4, 3, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(false, true, 2, 4, 4, true), true }, + { MatMulKernelInfo(false, true, 2, 4, 8, true), true }, + { MatMulKernelInfo(false, true, 2, 8, 16, true), true }, + + // Lhs transposed, Rhs-not-transposed { MatMulKernelInfo(true, false, 1, 1, 0), false }, // K0 should be > 0 { MatMulKernelInfo(true, false, 3, 11, 1), false }, // N0 not in {1, 2, 3, 4, 8, 16} { MatMulKernelInfo(true, false, 3, 7, 1), false }, // N0 not in {1, 2, 3, 4, 8, 16} @@ -128,7 +134,7 @@ TEST_CASE(SupportedBlockSizes, framework::DatasetMode::ALL) { MatMulKernelInfo(true, false, 2, 8, 8, true), true }, { MatMulKernelInfo(true, false, 2, 16, 8, true), true }, - // // Lhs transposed, Rhs-transposed + // Lhs transposed, Rhs-transposed { MatMulKernelInfo(true, true, 2, 1, 5), false }, // K0 should in {1, 2, 3, 4, 8, 16} { MatMulKernelInfo(true, true, 1, 8, 7), false }, // K0 should in {1, 2, 3, 4, 8, 16} { MatMulKernelInfo(true, true, 3, 11, 1), false }, // N0 not in {1, 2, 3, 4, 8, 16} @@ -138,6 +144,12 @@ TEST_CASE(SupportedBlockSizes, framework::DatasetMode::ALL) { MatMulKernelInfo(true, true, 4, 8, 16), true }, { MatMulKernelInfo(true, true, 3, 3, 4), true }, { MatMulKernelInfo(true, true, 16, 4, 8), true }, + { MatMulKernelInfo(true, true, 2, 2, 1, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(true, true, 2, 2, 5, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(true, true, 2, 4, 7, true), false }, // K0 not in {4, 8, 16} + { MatMulKernelInfo(true, true, 2, 4, 4, true), true }, + { MatMulKernelInfo(true, true, 2, 8, 8, true), true }, + { MatMulKernelInfo(true, true, 2, 8, 16, true), true }, }; // Set big enough shapes so that block sizes are not truncated. Also, set all dimensions equal @@ -183,6 +195,13 @@ TEST_CASE(ExportToCLImage, framework::DatasetMode::ALL) { 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, 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 }, + { TensorShape(12U, 1U), TensorShape(12U, 6U), false, true, true }, }; for(auto &tuple : shape_configurations) @@ -430,6 +449,36 @@ FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture, f validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32); } } +FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture, 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))) +{ + // Validate output + if(_device_supports_export_to_cl_image) + { + validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32); + } +} +FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture, 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))) +{ + // Validate output + if(_device_supports_export_to_cl_image) + { + validate(CLAccessor(_target), _reference, tolerance_f32, 0.f, abs_tolerance_f32); + } +} TEST_SUITE_END() // ExportRhsToCLImage TEST_SUITE_END() // FP32 @@ -498,7 +547,7 @@ FIXTURE_DATA_TEST_CASE(RunLargeLhsTransposedRhsTransposed, CLMatMulKernelFixture TEST_SUITE_END() // Buffer TEST_SUITE(ExportRhsToCLImage) -FIXTURE_DATA_TEST_CASE(RunSmallRhsCLImageRhsNotTransposed, CLMatMulKernelFixture, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(combine(datasets::SmallMatMulDatasetRhsExportToCLImageRhsNT(), +FIXTURE_DATA_TEST_CASE(RunSmallRhsNotTransposed, CLMatMulKernelFixture, 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 })), @@ -513,7 +562,7 @@ FIXTURE_DATA_TEST_CASE(RunSmallRhsCLImageRhsNotTransposed, CLMatMulKernelFixture validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16); } } -FIXTURE_DATA_TEST_CASE(RunLargeRhsCLImageRhsNotTransposed, CLMatMulKernelFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(datasets::LargeMatMulDatasetRhsExportToCLImageRhsNT(), +FIXTURE_DATA_TEST_CASE(RunLargeRhsNotTransposed, CLMatMulKernelFixture, 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 @@ -528,6 +577,36 @@ FIXTURE_DATA_TEST_CASE(RunLargeRhsCLImageRhsNotTransposed, CLMatMulKernelFixture validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16); } } +FIXTURE_DATA_TEST_CASE(RunSmallRhsTransposed, CLMatMulKernelFixture, 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))) +{ + // Validate output + if(_device_supports_export_to_cl_image) + { + validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16); + } +} +FIXTURE_DATA_TEST_CASE(RunLargeRhsTransposed, CLMatMulKernelFixture, 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))) +{ + // Validate output + if(_device_supports_export_to_cl_image) + { + validate(CLAccessor(_target), _reference, tolerance_f16, 0.f, abs_tolerance_f16); + } +} TEST_SUITE_END() // ExportRhsToCLImage TEST_SUITE_END() // FP16 TEST_SUITE_END() // Float -- cgit v1.2.1