How to allocate arbitrary sized array of MKL_Complex16 numbers?

How to allocate arbitrary sized array of MKL_Complex16 numbers?

Hi all,

I have been trying to alloacate arbitrary sized array of complex numbers using mkl_malloc and MKL_Complex16 or 8. However the regular mkl_malloc syntax (used say for array of double values) seems to produce segmentation_fault. On the other hand if mkl_malloc is changed to regular malloc everything passes but MKL_FFT functions don't return correct result. Here is the line I try to use:

struct _MKL_Complex16 * x = (struct _MKL_Complex16*) mkl_malloc(128 * sizeof(struct _MKL_Complex16), 64);

Where for example I try to allocate memory for 128 complex numbers. and 64 is allignment becuase my OS is 64-bit (is this correct?)... In real pratcitce I will need to allocate much more then 128 numbers. My advisor is telling me that on cluster we will need arrays sized in gigabytes so I really need a mechanism that can allocate lots of memory on heap.

Thanks for any help,

Bogdan

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Please make sure the compiler knows the prototype of mkl_malloc function. That is, #include <mkl.h> or at least #include <mkl_service.h>. Including just mkl_types.h is not enough.

Also, a correct program may produce segmentation faults if it is linked incorrectly. Could you post your build lines?

Thanks

Dima

Hi Dima, 

you where actually right. I forgot to put mkl.h into includes. I only put #include "mkl_dfti.h" which was not enough.

Everything works now.

Thanks!

 

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya