Managing Memory

To improve performance of your application that calls oneDAL, align your arrays on 64-byte boundaries and ensure that the leading dimensions of the arrays are divisible by 64. For that purpose oneDAL provides daal_malloc() and daal_free() functions to allocate and deallocate memory.

To allocate memory, call daal_malloc() with the specified size of the buffer to be allocated and the alignment of the buffer, which must be a power of 2. If the specified alignment is not a power of 2, the library uses the 32-byte alignment.

To deallocate memory allocated earlier by the daal_malloc() function, call the daal_free() function and set a pointer to the buffer to be freed.