added free of arrays
@@ -348,17 +348,49 @@ LIBXSMM_API_DEFINITION libxsmm_dnn_err_t libxsmm_dnn_destroy_conv_layer(const li
/* Deallocate per-thread jitted data structures */
if ( handle->use_thread_private_jit ) {
+
+ /* Free per thread allocated arrays */
for (loop = 0; loop < handle->desc.threads; loop++) {
+ /* Fwd related arrays */
if ( handle->compute_fwd_indices_ptrs[loop] != NULL ) {
libxsmm_free( handle->compute_fwd_indices_ptrs[loop] );
}
if ( handle->kernel_fwd_variant_ptrs[loop] != NULL ) {
libxsmm_free( handle->kernel_fwd_variant_ptrs[loop] );
}
+ if ( handle->fwd_code_segments[loop] != NULL ) {
+ libxsmm_free( handle->fwd_code_segments[loop] );
+ }
+ /* Bwd related arrays */
+ if ( handle->compute_bwd_indices_ptrs[loop] != NULL ) {
+ libxsmm_free( handle->compute_bwd_indices_ptrs[loop] );
+ }
+ if ( handle->kernel_bwd_variant_ptrs[loop] != NULL ) {
+ libxsmm_free( handle->kernel_bwd_variant_ptrs[loop] );
+ }
+ if ( handle->bwd_code_segments[loop] != NULL ) {
+ libxsmm_free( handle->bwd_code_segments[loop] );
}
+ if ( handle->transpose_bwd_indices_ptrs[loop] != NULL ) {
+ libxsmm_free( handle->transpose_bwd_indices_ptrs[loop] );
+ }
+ }
+
+ /* Free shared arrays */
free( handle->compute_fwd_indices_ptrs );
free( handle->kernel_fwd_variant_ptrs );
free( handle->n_entries_fwd );
+ free( handle->n_fwd_code_segments );
+ free( handle->ofh_fwd_start );
+ free( handle->ofh_fwd_end );
+
+ free( handle->compute_bwd_indices_ptrs );
+ free( handle->kernel_bwd_variant_ptrs );
+ free( handle->n_entries_bwd );
+ free( handle->n_bwd_code_segments );
+ free( handle->ofh_bwd_start );
+ free( handle->ofh_bwd_end );
+ free( handle->transpose_bwd_indices_ptrs );
}
if (handle->padding_flag) libxsmm_free(handle->scratch5);
