- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hija all
The mkl example (e.g.) complex_1d_double_ex1.c allocates memory as
/*
** Allocate array for input data
*/
x_in = (mkl_double_complex*)malloc(2*n*sizeof(double));
x_exp = (mkl_double_complex*)malloc(2*n*sizeof(double));
Would it not be 'nicer' to use?
//allocate memory
x = (mkl_double_complex*) malloc(n*sizeof(mkl_double_complex));
y = (mkl_double_complex*) malloc(n*sizeof(mkl_double_complex));
Thanks for your help
Erich
The mkl example (e.g.) complex_1d_double_ex1.c allocates memory as
/*
** Allocate array for input data
*/
x_in = (mkl_double_complex*)malloc(2*n*sizeof(double));
x_exp = (mkl_double_complex*)malloc(2*n*sizeof(double));
Would it not be 'nicer' to use?
//allocate memory
x = (mkl_double_complex*) malloc(n*sizeof(mkl_double_complex));
y = (mkl_double_complex*) malloc(n*sizeof(mkl_double_complex));
Thanks for your help
Erich
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Erich,
Strictly speaking, it would be nice to correctMKL examplesusing namely MKL complex types (see mkl_types.h). But currently, in DFTC exampes thereare introduced another additional types: mkl_double_complex and mkl_float_complex instead of using MKL_Complex16 and MKL_Complex8.
As to using sizeof(mkl_double_complex) instead of 2*sizeof(double), I guess, it's just a matter of taste.
Because these values are the same.
And if validation of results is made by calculation with complex numbers then they should be defined as complex. But currently in DFTC examples all support functions are implemented as interleaved real numbers (see source/dfti_example_support.c)
Strictly speaking, it would be nice to correctMKL examplesusing namely MKL complex types (see mkl_types.h). But currently, in DFTC exampes thereare introduced another additional types: mkl_double_complex and mkl_float_complex instead of using MKL_Complex16 and MKL_Complex8.
As to using sizeof(mkl_double_complex) instead of 2*sizeof(double), I guess, it's just a matter of taste.
Because these values are the same.
And if validation of results is made by calculation with complex numbers then they should be defined as complex. But currently in DFTC examples all support functions are implemented as interleaved real numbers (see source/dfti_example_support.c)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page