Skip to content

Commit b2e948f

Browse files
committed
cpu: x64: brgemm bwd_w convolution: fix batchsizes indexes
1 parent 4c34f89 commit b2e948f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cpu/x64/jit_brgemm_conv_bwd_w.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ status_t brgemm_convolution_bwd_weights_t::pd_t::init(engine_t *engine) {
9898
auto M = (i) ? jcp_.M_tail : jcp_.M;
9999
if (M <= 0) continue;
100100
// init only needed brgemm descriptors
101-
for (int bs = 0; bs <= jcp_.max_batch; bs++) {
101+
const auto bs_end = jcp_.var_bs ? 1 : jcp_.max_batch;
102+
for (int bs = 0; bs <= bs_end; bs++) {
102103
if (batchsizes[bs] == -1) continue;
103104
for_(int i_init = init_begin; i_init < init_end; i_init++)
104105
for_(int i_N = N_begin; i_N < N_end; i_N++)
@@ -274,7 +275,8 @@ status_t brgemm_convolution_bwd_weights_t::init(engine_t *engine) {
274275
int init_begin = 0;
275276
int init_end = 2;
276277

277-
for (int bs = 0; bs <= jcp.max_batch; bs++) {
278+
const auto bs_end = jcp.var_bs ? 1 : jcp.max_batch;
279+
for (int bs = 0; bs <= bs_end; bs++) {
278280
if (_pd->batchsizes[bs] == -1) continue;
279281

280282
for_(int i_N = N_begin; i_N < N_end; i_N++)

0 commit comments

Comments
 (0)