Added barriers and removed prefetching
@@ -299,15 +299,15 @@ if (libxsmm_target_archid == LIBXSMM_X86_AVX512_MIC ||
libxsmm_target_archid == LIBXSMM_X86_AVX512_KNM) {
#if defined(INPUT_PADDING)
- //libxsmm_barrier_init(handle->barrier, ltid);
+ libxsmm_barrier_init(handle->barrier, ltid);
/* Initialize in parallel scratch5 to zero */
- /*for (imgifm1 = copy_thr_begin; imgifm1 < copy_thr_end; ++imgifm1) {
+ for (imgifm1 = copy_thr_begin; imgifm1 < copy_thr_end; ++imgifm1) {
img = imgifm1/handle->blocksifm;
ifm1 = imgifm1%handle->blocksifm;
copy_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_padded, img, ifm1, 0, 0, 0, handle->blocksifm, padded_h, padded_w, handle->ifmblock);
jitted_matzero(NULL, NULL, copy_ptr, NULL, NULL);
- }*/
- //libxsmm_barrier_wait(handle->barrier, ltid);
+ }
+ libxsmm_barrier_wait(handle->barrier, ltid);
/* Copy the minibatch to a padded version only if no transpose is required -- otherwise we combine the transpose with the copying into the padded buffer */
#ifndef LIBXSMM_WU_TRANSPOSE_OFW_IFM
@@ -316,16 +316,16 @@ if (libxsmm_target_archid == LIBXSMM_X86_AVX512_MIC ||
ifm1 = imgifm1%handle->blocksifm;
input_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_nopad, img, ifm1, 0, 0, 0, handle->blocksifm, handle->ifhp, handle->ifwp, handle->ifmblock);
copy_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_padded, img, ifm1, handle->desc.pad_h, handle->desc.pad_w, 0, handle->blocksifm, padded_h, padded_w, handle->ifmblock);
- if (ifm1 != 0) {
+ //if (ifm1 != 0) {
/* Prefetch next ifm, same image */
- prefetch_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_nopad, img, ifm1-1, 0, 0, 0, handle->blocksifm, handle->ifhp, handle->ifwp, handle->ifmblock);
- } else {
+ // prefetch_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_nopad, img, ifm1-1, 0, 0, 0, handle->blocksifm, handle->ifhp, handle->ifwp, handle->ifmblock);
+ //} else {
/* Prefetch ifm 0 from next image */
- prefetch_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_nopad, img-1, handle->blocksifm-1, 0, 0, 0, handle->blocksifm, handle->ifhp, handle->ifwp, handle->ifmblock);
- }
+ // prefetch_ptr = (element_input_type*)&LIBXSMM_VLA_ACCESS(5, input_nopad, img-1, handle->blocksifm-1, 0, 0, 0, handle->blocksifm, handle->ifhp, handle->ifwp, handle->ifmblock);
+ //}
jitted_matcopy(input_ptr, NULL, copy_ptr, NULL, prefetch_ptr);
}
- //libxsmm_barrier_wait(handle->barrier, ltid);
+ libxsmm_barrier_wait(handle->barrier, ltid);
#endif
#endif
