Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DarioMangoni
Beginner
99 Views

mkl_realloc alignment

Hi,
I'm facing a problem probably due to misalignment so I decided to use mkl_*alloc with Parallel Direct Sparse Solver.

The solver needs 64byte alignment that is succesfully obtained my mkl_malloc/mkl_calloc specifying the alignment parameter.
Unfortunately this is not possible with mkl_realloc: its default is a simple 16byte alignment and nothing can be done to bypass this default behaviour.
Any workaround?

Thanks,
Dario

0 Kudos
5 Replies
Gennady_F_Intel
Moderator
99 Views

voidmkl_realloc (void *ptrsize_t size);  If ptr is NULL, the function works as mkl_malloc !

DarioMangoni
Beginner
99 Views

Sorry, maybe I didn't specify that I WANT to reallocate that vector! If I didn't want to, I'd use mkl_malloc!
If I use mkl_realloc to reallocate, the address is no more 64byte aligned!

I can create another array with mkl_malloc and then copy the data, but the memory peak (mkl_peak_mem_usage()) is incredibly higher than using mkl_realloc.

Another question... does mkl_realloc try to "expand" the current array before moving it elsewhere?

Gennady_F_Intel
Moderator
99 Views

thanks for the issue. mkl_realloc doesn't remember the alignment of the "original" array but it must to keep this alignment. We will fix this into one of the next releases/updates.

 

Gennady_F_Intel
Moderator
99 Views

the problem has been fixed in MKL v.11.3.1

Eugene_S_1
Beginner
99 Views

Please amend the documentation on mkl_realloc by explicitly stating that alignment is preserved. Now it says nothing about the alignment of a new buffer.

Reply