Skip to content

Commit 379a216

Browse files
aaraujomtprimak
authored andcommitted
cpu: x64: gemm: fix sgemv thread checker
1 parent bacaf56 commit 379a216

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cpu/x64/gemm/gemv_driver.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ static inline int thread_checker(
257257
if (bandt == 0) {
258258
return 1;
259259
} else {
260-
return nstl::min(
261-
nstl::max(n * m / 2 * MN_MIN_N, dim_t(1)), dim_t(nthr));
260+
return nstl::min(nstl::max(n * m / (2 * MN_MIN_N), dim_t(1)),
261+
dim_t(nthr));
262262
}
263263
}
264264
} else {
@@ -290,6 +290,12 @@ static inline void decompose_vector(const dim_t m, const dim_t nthr,
290290
dim_t loffset = 0;
291291
dim_t lsize = 0;
292292

293+
if (ithr >= nthr) {
294+
*offset = loffset;
295+
*size = lsize;
296+
return;
297+
}
298+
293299
if (addr == NULL) {
294300
dim_t xthr = m % nthr;
295301
dim_t width = m / nthr;

0 commit comments

Comments
 (0)