55#include < executorch/backends/cadence/reference/kernels/kernels.h>
66#include < executorch/backends/cadence/reference/operators/operators.h>
77
8- using executorch::runtime::getLeadingDims;
9-
108// Generate kernels that perform elementwise arithmetic on two quantized
119// tensors. The tensors are either the same size, or the second tensor is a
1210// scalar.
@@ -65,7 +63,8 @@ inline __attribute__((always_inline)) void quantized_linear_per_tensor_(
6563 // weight comes in shape [out_dim, in_dim]
6664 // output comes in empty with shape [leading_dims, out_dim]
6765 // Perform matrix multiply (M x N) x (N x P)' => M x P
68- const int64_t leading_dims = getLeadingDims (src, src.dim () - 1 );
66+ const int64_t leading_dims =
67+ executorch::runtime::getLeadingDims (src, src.dim () - 1 );
6968 const int64_t out_dim = weight.size (0 ); // = out_dim
7069 const int64_t in_dim = weight.size (1 ); // = in_dim
7170
@@ -87,13 +86,8 @@ inline __attribute__((always_inline)) void quantized_linear_per_tensor_(
8786 (int32_t )weight_data[j * in_dim + k] - (int32_t )weight_zero_point;
8887 sum += x * w;
8988 }
90- <<<<<<< HEAD
9189 out_data[i * out_dim + j] = ::impl::reference::kernels::quantize<T>(
9290 sum, requant_scale, out_zero_point);
93- =======
94- out_data[i * out_dim + j] =
95- ::impl::reference::kernels::quantize<T>(sum, requant_scale, out_zero_point);
96- >>>>>>> 5ebcf7f03 (create quantized_linear_per_tensor_out in cpu)
9791 }
9892 }
9993}
@@ -138,7 +132,8 @@ inline __attribute__((always_inline)) void quantized_linear_per_channel_(
138132 // weight comes in shape [out_dim, in_dim]
139133 // output comes in empty with shape [leading_dims, out_dim]
140134 // Perform matrix multiply (M x N) x (N x P)' => M x P
141- int64_t leading_dims = getLeadingDims (src, src.dim () - 1 );
135+ int64_t leading_dims =
136+ executorch::runtime::getLeadingDims (src, src.dim () - 1 );
142137 const int64_t out_dim = weight.size (0 ); // = out_dim
143138 const int64_t in_dim = weight.size (1 ); // = in_dim
144139
0 commit comments