Skip to content

Commit dc69ce5

Browse files
committed
[Fork][Fix] Fix avx2 bf16 reorder
1 parent d19b5d8 commit dc69ce5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cpu/x64/jit_uni_reorder.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator {
192192
&& utils::everyone_is(0, p.ioff, p.ooff) /* do we need this? */
193193
&& utils::one_of(p.beta, 0.f, 1.f) /* anything else? */
194194
&& simple_impl_desc_init(p, nullptr) && mayiuse(sse41)
195-
&& IMPLICATION(utils::one_of(bf16, p.itype, p.otype),
196-
mayiuse(avx512_core) || mayiuse(avx2))
195+
&& IMPLICATION(bf16 == p.itype, mayiuse(avx2))
196+
&& IMPLICATION((bf16 == p.otype) && (bf16 != p.itype),
197+
mayiuse(avx512_core) || mayiuse(avx2_vnni_2))
197198
&& IMPLICATION(utils::one_of(f16, p.itype, p.otype),
198199
mayiuse(avx512_core_fp16) || mayiuse(avx2))
199200
&& IMPLICATION(!is_direct_copy(p), prb_has_small_strides(p));
@@ -1428,7 +1429,7 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator {
14281429
otype_sz_ = data_type_size(prb_.otype);
14291430
stype_sz_ = sizeof(float);
14301431
if (prb_.otype == data_type::bf16 && !mayiuse(avx512_core_bf16)
1431-
&& !mayiuse(avx2_vnni_2)) {
1432+
&& !mayiuse(avx2_vnni_2) && mayiuse(avx512_core)) {
14321433
bf16_emu_ = utils::make_unique<bf16_emulation_t>(this,
14331434
bf16_emu_reserv_1_, bf16_emu_reserv_2_, bf16_emu_reserv_3_,
14341435
bf16_emu_scratch_, bf16_emu_reserv_4_);

0 commit comments

Comments
 (0)