Skip to content

Commit 74fb846

Browse files
committed
cpu: x64: brgemm: update oh blocking
1 parent feeddcb commit 74fb846

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cpu/x64/jit_brgemm_conv_utils.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ void brg_blocking_t::iterate_ker_block(brg_blocking_t &best_brgb, int kd_block_,
10281028
1, od, int(L1 / (ihp * src_w_block_size)));
10291029
if (cur_od_block == 1)
10301030
cur_oh_block = utils::saturate(
1031-
1, oh, int(L1 / (src_w_block_size)));
1031+
1, oh, static_cast<int>(L1 / src_w_block_size));
10321032
}
10331033
for (; cur_od_block > 1; cur_od_block--) {
10341034
const auto sp_size = cur_od_block * cur_oh_block * iwp;
@@ -1040,14 +1040,17 @@ void brg_blocking_t::iterate_ker_block(brg_blocking_t &best_brgb, int kd_block_,
10401040
}
10411041
}
10421042
if (cur_od_block == 1) {
1043-
for (; cur_oh_block > 1; cur_oh_block--) {
1044-
const auto sp_size = cur_oh_block * iwp;
1045-
if ((static_cast<float>(oh) / rnd_up(oh, cur_oh_block))
1043+
auto tmp_oh_block = cur_oh_block;
1044+
while (tmp_oh_block >= 1) {
1045+
const auto sp_size = tmp_oh_block * iwp;
1046+
if ((static_cast<float>(oh) / rnd_up(oh, tmp_oh_block))
10461047
> 0.9f
10471048
&& sp_size > 128) {
10481049
L1_fit_res = true;
1050+
cur_oh_block = tmp_oh_block;
10491051
break;
10501052
}
1053+
tmp_oh_block--;
10511054
}
10521055
}
10531056
if (L1_fit_res) {

0 commit comments

Comments
 (0)