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

Commit

Permalink
code scan fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyu-intel committed May 29, 2024
1 parent 12ef415 commit e8829a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bestla/bestla/bestla_parallel.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ class SchedulerBase : public Scheduler2D {
mBlock[1] = mThdSize[1];
}
bsize = KRef * mBlock[1] * mEleSize[1] * 2;
size_t csize = mBlock[0] * mBlock[1] * mEleSize[2];
size_t csize = static_cast<size_t>(mBlock[0]) * mBlock[1] * mEleSize[2];
auto rawk = static_cast<int>((valid_total - csize) / (mStep[0] * mEleSize[0] + mBlock[1] * mEleSize[1]) / 2);
rawk = std::min(rawk, mSizePadded[2]);
mBlock[2] = utils::padto_le(rawk, mStep[2]);
Expand Down Expand Up @@ -634,14 +634,14 @@ class SchedulerKBlockS : public SchedulerBase<_GemmCore_T> {
} else {
this->mBlock[1] = this->mThdSize[1];
}
auto rawk = static_cast<int>((valid_total - this->mBlock[0] * this->mBlock[1] * this->mEleSize[2]) / 2 /
size_t csize = static_cast<size_t>(mBlock[0]) * mBlock[1] * this->mEleSize[2];
auto rawk = static_cast<int>((valid_total - csize) / 2 /
(this->mStep[0] * this->mEleSize[0] +
float(CorSize * (this->mStep[0] + this->mBlock[1])) / this->mKBlock +
this->mBlock[1] * this->mEleSize[1]));
if (rawk < this->mKBlock) {
rawk = static_cast<int>((valid_total - this->mBlock[0] * this->mBlock[1] * this->mEleSize[2] -
1 * CorSize * (this->mStep[0] + this->mBlock[1])) /
2 / (this->mStep[0] * this->mEleSize[0] + this->mBlock[1] * this->mEleSize[1]));
rawk = static_cast<int>((valid_total - csize - 1 * CorSize * (this->mStep[0] + this->mBlock[1])) / 2 /
(this->mStep[0] * this->mEleSize[0] + this->mBlock[1] * this->mEleSize[1]));
}
rawk = std::min(rawk, this->mSizePadded[2]);
this->mBlock[2] = utils::padto_le(rawk, this->mStep[2]);
Expand Down

0 comments on commit e8829a2

Please sign in to comment.