Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
fix coverity scan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
luo-cheng2021 committed Jul 24, 2023
1 parent 11833d8 commit 0295279
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tensor tensor::index(const std::initializer_list<tensor_index>& indices) const {
int i_dst = 0;
sub_tensor.m_capacity = 0;
size_t off = 0;
for (auto idx : indices) {
for (auto& idx : indices) {
auto src_dim = m_dims[i_src];
auto src_stride = m_strides[i_src];
idx.regularize(src_dim);
Expand Down
2 changes: 1 addition & 1 deletion src/common/tensor2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct tensor2D {
int64_t capacity = 0;
int stride = 0;
bool force_compact = false;
bool own;
bool own = false;
int padded_dim1 = 0;

tensor2D() = default;
Expand Down
6 changes: 6 additions & 0 deletions src/mm_kernel_common_amx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ namespace functional {
re = _mm512_setzero_epi32();
rf = _mm512_setzero_epi32();
break;
default:
assert(false);
return;
}

transpose_m512i_16x16(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, ra, rb, rc, rd, re, rf);
Expand Down Expand Up @@ -802,6 +805,9 @@ namespace functional {
re = _mm512_setzero_epi32();
rf = _mm512_setzero_epi32();
break;
default:
assert(false);
return;
}
transpose_m512i_16x16(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, ra, rb, rc, rd, re, rf);
_mm512_storeu_epi32(dst, r0);
Expand Down

0 comments on commit 0295279

Please sign in to comment.