text stringlengths 0 2.2M |
|---|
// Tail processing
|
if (get_ic_tail() && os_b == 1) {
|
reset_tiles(os_b, true);
|
compute_block(nb_ic_int, os_b);
|
reset_tiles(os_b, false);
|
}
|
};
|
Label label_last_os, label_compute_done, label_tail, label_done;
|
int stride_nhwc_ = jcp.typesize_in * jcp.ngroups * jcp.ic_without_padding
|
* jcp.stride_w;
|
mov(stride_nhwc, stride_nhwc_);
|
prepare_output();
|
{ // Compute
|
if (check_last_sb_) {
|
mov(reg_last_h, ptr[param1 + GET_OFF(last_h)]);
|
cmp(reg_last_h, 1);
|
je(label_last_os, T_NEAR);
|
}
|
compute_icb_loop(jcp.nb_os_blocking);
|
jmp(label_compute_done, T_NEAR);
|
L(label_last_os);
|
compute_icb_loop();
|
}
|
L(label_compute_done);
|
{ // Store
|
if (jcp.tile_tail && check_last_sb_)
|
store_output(do_store, true);
|
else
|
store_output(do_store, false);
|
}
|
}
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::osb_loop(int nb_os) {
|
for (int osi = 0; osi < nb_os; osi++) {
|
bool do_store = IMPLICATION(jcp.per_one_pstore, (osi == nb_os - 1));
|
check_last_sb_ = do_store;
|
icb_loop(do_store);
|
int oh = (((osi + 1) * jcp.nb_os_blocking * jcp.tile_width) / jcp.ow);
|
int ow = (((osi + 1) * jcp.nb_os_blocking * jcp.tile_width) % jcp.ow);
|
if (do_store) {
|
size_t out_offset = jcp.typesize_out
|
* (oh * out_h_shift() + ow * out_w_shift());
|
add(out_ptr, out_offset);
|
}
|
int ih = oh * jcp.stride_h;
|
int iw = ow * jcp.stride_w;
|
add(inp_ptr, inp_offset(ih, iw, 0));
|
}
|
}
|
int jit_avx512_core_amx_1x1_fwd_kernel_t::get_ic_tail() const {
|
return (jcp.ic_without_padding % jcp.ic_block_int_np);
|
}
|
void jit_avx512_core_amx_1x1_fwd_kernel_t::generate() {
|
preamble();
|
last_oc_block_flag_ = (jcp.oc_without_padding != jcp.oc);
|
if (last_oc_block_flag_) {
|
Xbyak::Label mask_is_set;
|
// Use mask 0xF by default for all output data and post-ops
|
// loads / stores with block index
|
// ocb = occ * jcp.nb_oc_blocking + (jcp.nb_oc_blocking - 1)
|
// TODO: use masked loads / stores for the last occ only
|
int mask = (1 << jcp.oc_block) - 1;
|
Xbyak::Reg32 regw_tmp = reg_tmp.cvt32();
|
mov(regw_tmp, mask);
|
kmovw(ktail_mask, regw_tmp);
|
mov(reg_oc_blocks, ptr[param1 + GET_OFF(oc_blocks)]);
|
cmp(reg_oc_blocks, jcp.nb_oc - jcp.nb_oc_blocking);
|
jne(mask_is_set, T_NEAR);
|
// Reset the mask
|
mask = (1 << (jcp.oc_without_padding % jcp.oc_block)) - 1;
|
mov(regw_tmp, mask);
|
kmovw(ktail_mask, regw_tmp);
|
L(mask_is_set);
|
}
|
mov(inp_ptr, ptr[param1 + GET_OFF(src)]);
|
mov(wei_ptr, ptr[param1 + GET_OFF(filt)]);
|
mov(out_ptr, ptr[param1 + GET_OFF(dst)]);
|
mov(wsp_ptr, ptr[param1 + GET_OFF(acc_s32)]);
|
mov(reg_is_osb, ptr[param1 + GET_OFF(is_osb)]);
|
constexpr int tile_mem_stride_in_bytes = 64;
|
mov(stride_seq, tile_mem_stride_in_bytes);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.