diff --git a/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8sxsym8s_asym8s_per_tensor_out.cpp b/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8sxsym8s_asym8s_per_tensor_out.cpp index c1b5a1836a3..28cf6ab5af6 100644 --- a/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8sxsym8s_asym8s_per_tensor_out.cpp +++ b/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8sxsym8s_asym8s_per_tensor_out.cpp @@ -57,15 +57,9 @@ void xa_opt_quantized_conv1d_nchw_asym8sxsym8s_asym8s( WORD32 x_stride = stride[1]; WORD32 x_padding = padding[1]; WORD32 input_zero_bias = -in_zero_point; - WORD32 out_multiplier32[out_channels]; - WORD32 out_shift32[out_channels]; + WORD32 out_multiplier32 = bias_scale * (1. / output_scale) * 2147483648; + WORD32 out_shift32 = 0; WORD32 kernel_zero_bias = -weight_zero_point; - float out_scale = 1. / output_scale; - - for (int i = 0; i < out_channels; i++) { - out_multiplier32[i] = bias_scale * out_scale * 2147483648; - out_shift32[i] = 0; - } WORD32 out_zero_bias = output_zero_point; WORD32 out_data_format = 1; @@ -129,9 +123,9 @@ void xa_opt_quantized_conv1d_nchw_asym8sxsym8s_asym8s( WORD8* out_batch = p_out + _n * out_channels * out_width; xa_nn_conv1d_std_asym8xasym8( - out_batch, - in_batch, - pkernel, + (UWORD8*)out_batch, + (UWORD8*)in_batch, + (UWORD8*)pkernel, p_bias, 1, input_width, diff --git a/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8uxsym8u_asym8u_per_tensor_out.cpp b/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8uxsym8u_asym8u_per_tensor_out.cpp index fae49ec97c7..531ae8837ec 100644 --- a/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8uxsym8u_asym8u_per_tensor_out.cpp +++ b/backends/cadence/hifi/operators/op_quantized_conv1d_nchw_asym8uxsym8u_asym8u_per_tensor_out.cpp @@ -57,15 +57,9 @@ void xa_opt_quantized_conv1d_nchw_asym8uxsym8u_asym8u( WORD32 x_stride = stride[1]; WORD32 x_padding = padding[1]; WORD32 input_zero_bias = -in_zero_point; - WORD32 out_multiplier32[out_channels]; - WORD32 out_shift32[out_channels]; + WORD32 out_multiplier32 = bias_scale * (1. / output_scale) * 2147483648; + WORD32 out_shift32 = 0; WORD32 kernel_zero_bias = -weight_zero_point; - float out_scale = 1. / output_scale; - - for (int i = 0; i < out_channels; i++) { - out_multiplier32[i] = bias_scale * out_scale * 2147483648; - out_shift32[i] = 0; - } WORD32 out_zero_bias = output_zero_point; WORD32 out_data_format = 1; @@ -90,9 +84,9 @@ void xa_opt_quantized_conv1d_nchw_asym8uxsym8u_asym8u( WORD32 p_permute_vec[kNnlibMaxDim] = {0, 2, 1}; xa_nn_transpose_8_8( - pin, + (WORD8*)pin, p_out_shape, - p_inp, + (WORD8*)p_inp, p_inp_shape, p_permute_vec, kNnlibMaxDim, @@ -109,9 +103,9 @@ void xa_opt_quantized_conv1d_nchw_asym8uxsym8u_asym8u( p_out_shape1[2] = kernel_channels; xa_nn_transpose_8_8( - pkernel, + (WORD8*)pkernel, p_out_shape1, - p_kernel, + (WORD8*)p_kernel, p_inp_shape1, p_permute_vec, kNnlibMaxDim, diff --git a/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8sxsym8s_asym8s_per_tensor_out.cpp b/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8sxsym8s_asym8s_per_tensor_out.cpp index a2cb591b3a7..712afae926a 100644 --- a/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8sxsym8s_asym8s_per_tensor_out.cpp +++ b/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8sxsym8s_asym8s_per_tensor_out.cpp @@ -54,15 +54,9 @@ void xa_opt_quantized_conv1d_nhwc_asym8sxsym8s_asym8s( WORD32 x_stride = stride[1]; WORD32 x_padding = padding[1]; WORD32 input_zero_bias = -in_zero_point; - WORD32 out_multiplier32[out_channels]; - WORD32 out_shift32[out_channels]; + WORD32 out_multiplier32 = bias_scale * (1. / output_scale) * 2147483648; + WORD32 out_shift32 = 0; WORD32 kernel_zero_bias = -weight_zero_point; - float out_scale = 1. / output_scale; - - for (int i = 0; i < out_channels; i++) { - out_multiplier32[i] = bias_scale * out_scale * 2147483648; - out_shift32[i] = 0; - } WORD32 out_zero_bias = output_zero_point; WORD32 out_data_format = 0; @@ -78,9 +72,9 @@ void xa_opt_quantized_conv1d_nhwc_asym8sxsym8s_asym8s( WORD8* out_batch = p_out + _n * out_channels * out_width; xa_nn_conv1d_std_asym8xasym8( - out_batch, - in_batch, - p_kernel, + (UWORD8*)out_batch, + (UWORD8*)in_batch, + (UWORD8*)p_kernel, p_bias, 1, input_width, diff --git a/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8uxsym8u_asym8u_per_tensor_out.cpp b/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8uxsym8u_asym8u_per_tensor_out.cpp index 441952ca189..b87d1060d46 100644 --- a/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8uxsym8u_asym8u_per_tensor_out.cpp +++ b/backends/cadence/hifi/operators/op_quantized_conv1d_nhwc_asym8uxsym8u_asym8u_per_tensor_out.cpp @@ -54,15 +54,9 @@ void xa_opt_quantized_conv1d_nhwc_asym8uxsym8u_asym8u( WORD32 x_stride = stride[1]; WORD32 x_padding = padding[1]; WORD32 input_zero_bias = -in_zero_point; - WORD32 out_multiplier32[out_channels]; - WORD32 out_shift32[out_channels]; + WORD32 out_multiplier32 = bias_scale * (1. / output_scale) * 2147483648; + WORD32 out_shift32 = 0; WORD32 kernel_zero_bias = -weight_zero_point; - float out_scale = 1. / output_scale; - - for (int i = 0; i < out_channels; i++) { - out_multiplier32[i] = bias_scale * out_scale * 2147483648; - out_shift32[i] = 0; - } WORD32 out_zero_bias = output_zero_point; WORD32 out_data_format = 0;