Skip to content

Fix lints from HUD #7110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions backends/cadence/fusion_g3/operators/op_add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,26 @@ Tensor& add_out(
}

for (int i = 0; i < max_dim; i++) {
out_shape[i] = 1;
out_shape[i] = 1;
inp1_shape[i] = 1;
inp2_shape[i] = 1;
}
int offset_out = max_dim - out.dim();

int offset_out = max_dim - out.dim();
int offset_inp1 = max_dim - a.dim();
int offset_inp2 = max_dim - b.dim();

for (int i = 0; i < out.dim(); i++) {
out_shape[i + offset_out] = out.size(i);
}
for (int i = 0; i < a.dim(); i++) {
inp1_shape[i + offset_inp1] = a.size(i);
}
for (int i = 0; i < b.dim(); i++) {
inp2_shape[i + offset_inp2] = b.size(i);
inp2_shape[i + offset_inp2] = b.size(i);
}

if ((compute_type == ScalarType::Int) && (optimized)){
if ((compute_type == ScalarType::Int) && (optimized)) {
const int* const inp1_data = a.const_data_ptr<int>();
const int* const inp2_data = b.const_data_ptr<int>();
int* const out_data = out.mutable_data_ptr<int>();
Expand Down
10 changes: 5 additions & 5 deletions backends/cadence/fusion_g3/operators/op_mul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,23 @@ Tensor& mul_out(
}

for (int i = 0; i < max_dim; i++) {
out_shape[i] = 1;
out_shape[i] = 1;
inp1_shape[i] = 1;
inp2_shape[i] = 1;
}
int offset_out = max_dim - out.dim();

int offset_out = max_dim - out.dim();
int offset_inp1 = max_dim - a.dim();
int offset_inp2 = max_dim - b.dim();

for (int i = 0; i < out.dim(); i++) {
out_shape[i + offset_out] = out.size(i);
}
for (int i = 0; i < a.dim(); i++) {
inp1_shape[i + offset_inp1] = a.size(i);
}
for (int i = 0; i < b.dim(); i++) {
inp2_shape[i + offset_inp2] = b.size(i);
inp2_shape[i + offset_inp2] = b.size(i);
}

if ((compute_type == ScalarType::Int) && (optimized)) {
Expand Down
1 change: 0 additions & 1 deletion backends/cadence/hifi/operators/op_maximum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ using torch::executor::apply_binary_elementwise_fn;
using torch::executor::Error;
using torch::executor::resize_to_broadcast_target_size;


namespace cadence {
namespace impl {
namespace HiFi {
Expand Down
1 change: 0 additions & 1 deletion backends/cadence/hifi/operators/op_pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,3 @@ Tensor& pow_Scalar_out(
} // namespace HiFi
} // namespace impl
} // namespace cadence

31 changes: 15 additions & 16 deletions backends/cadence/hifi/operators/quantized_linear_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ using ::executorch::aten::Tensor;
using ::executorch::runtime::getLeadingDims;
using ::executorch::runtime::KernelRuntimeContext;


// The nnlib kernel to compute quantized linear via matmul.
// The nnlib kernel to compute quantized linear via matmul.

void _quantized_linear_asym8u(
const Tensor& in,
Expand All @@ -48,22 +47,22 @@ void _quantized_linear_asym8u(
const int32_t* __restrict__ bias_data = bias.const_data_ptr<int32_t>();
uint8_t* __restrict__ out_data = out.mutable_data_ptr<uint8_t>();
int32_t ret = xa_nn_matmul_asym8uxasym8u_asym8u(
out_data,
weight_data,
in_data,
bias_data,
out_dim,
in_dim,
in_dim,
leading_dims,
in_dim,
out_dim,
1,
out_data,
weight_data,
in_data,
bias_data,
out_dim,
in_dim,
in_dim,
leading_dims,
in_dim,
out_dim,
1,
-weight_zero_point.const_data_ptr<int32_t>()[0], // mat1_zero_bias
-in_zero_point, // mat2_zero_bias
out_multiplier.const_data_ptr<int32_t>()[0],
out_shift.const_data_ptr<int32_t>()[0],
out_zero_point);
out_multiplier.const_data_ptr<int32_t>()[0],
out_shift.const_data_ptr<int32_t>()[0],
out_zero_point);
ET_DCHECK_MSG(ret == 0, "HiFi quantized::linear failed");
}

Expand Down
Loading