From 1c0de4f11e5ec6ccddc2582de14d1af74f2cb6f6 Mon Sep 17 00:00:00 2001 From: Tomasz Dolbniak Date: Tue, 26 Nov 2024 13:04:56 +0100 Subject: [PATCH 1/2] [compute/cker] Remove the storage order parametrization from BatchMatMul This commit removes the obsolete parametrization of the BatchMatMul x86 optimized kernel. The reason is that the storage order attribute of the MatrixParams class is later ignored by the x86 Gemm implementation using Eigen. ONE-DCO-1.0-Signed-off-by: Tomasz Dolbniak t.dolbniak@partner.samsung.com --- compute/cker/include/cker/operation/optimized/BatchMatMul.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/compute/cker/include/cker/operation/optimized/BatchMatMul.h b/compute/cker/include/cker/operation/optimized/BatchMatMul.h index ea1b744fbed..405f3c91cbc 100644 --- a/compute/cker/include/cker/operation/optimized/BatchMatMul.h +++ b/compute/cker/include/cker/operation/optimized/BatchMatMul.h @@ -33,17 +33,14 @@ inline void BatchMatMul(const BatchMatMulParams ¶ms, const float *lhs_data, const float *rhs_data, float *output_data) { MatrixParams lhs_params; - lhs_params.order = Order::kRowMajor; lhs_params.rows = params.lhs_rows; lhs_params.cols = params.lhs_cols; MatrixParams rhs_params; - rhs_params.order = Order::kRowMajor; rhs_params.rows = params.rhs_rows; rhs_params.cols = params.rhs_cols; MatrixParams dst_params; - dst_params.order = Order::kRowMajor; dst_params.rows = params.lhs_rows; dst_params.cols = params.rhs_cols; From 09670cfd42c05051822979b0c42ed86ffa8d159a Mon Sep 17 00:00:00 2001 From: Tomasz Dolbniak Date: Wed, 27 Nov 2024 12:35:10 +0100 Subject: [PATCH 2/2] Revert the storage order with some comments --- compute/cker/include/cker/operation/optimized/BatchMatMul.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compute/cker/include/cker/operation/optimized/BatchMatMul.h b/compute/cker/include/cker/operation/optimized/BatchMatMul.h index 405f3c91cbc..15a46fcce6f 100644 --- a/compute/cker/include/cker/operation/optimized/BatchMatMul.h +++ b/compute/cker/include/cker/operation/optimized/BatchMatMul.h @@ -33,14 +33,17 @@ inline void BatchMatMul(const BatchMatMulParams ¶ms, const float *lhs_data, const float *rhs_data, float *output_data) { MatrixParams lhs_params; + lhs_params.order = Order::kRowMajor; // ignored by GemmImplUsingEigen lhs_params.rows = params.lhs_rows; lhs_params.cols = params.lhs_cols; MatrixParams rhs_params; + lhs_params.order = Order::kRowMajor; // ignored by GemmImplUsingEigen rhs_params.rows = params.rhs_rows; rhs_params.cols = params.rhs_cols; MatrixParams dst_params; + lhs_params.order = Order::kRowMajor; // ignored by GemmImplUsingEigen dst_params.rows = params.lhs_rows; dst_params.cols = params.rhs_cols;