- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I am trying to run the FFT code exemple. I am using Visual Studio with the intel 2019 compiler
this is my code #include "pch.h" #include <iostream> #include "mkl_dfti.h" int main() { /* C example, float _Complex is defined in C9X */ float _Complex x_in[32]; float _Complex x_out[32]; float y_in[32]; float y_out[34]; DFTI_DESCRIPTOR_HANDLE my_desc1_handle; DFTI_DESCRIPTOR_HANDLE my_desc2_handle; MKL_LONG status; //...put input data into x_in[0],...,x_in[31]; y_in[0],...,y_in[31] for (int i = 0; i < 32; i++) { x_in = cos(2 * 3.1415926535897932384626433832795*i * 4 / 32); } status = DftiCreateDescriptor(&my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, 32); status = DftiSetValue(my_desc1_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); status = DftiCommitDescriptor(my_desc1_handle); status = DftiComputeForward(my_desc1_handle, x_in, x_out); status = DftiFreeDescriptor(&my_desc1_handle); /* result is x_out[0], ..., x_out[31]*/ status = DftiCreateDescriptor(&my_desc2_handle, DFTI_SINGLE, DFTI_REAL, 1, 32); Status = DftiSetValue(My_Desc2_Handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); status = DftiCommitDescriptor(my_desc2_handle); status = DftiComputeForward(my_desc2_handle, y_in, y_out); status = DftiFreeDescriptor(&my_desc2_handle); /* result is given by y_out in CCS format*/ }
And I have problems with the float _Complex type.
I have set the '/Qstd=c99' option in my project but visual studio returns an error about this option. It says "the '/Qstd=c99' option is not valid for C++ compilations"
My program is not a c++ program
Any idea to solve this problem
Remi
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have included iostream, which is C++ header.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have made a new project with no iostream and no pch.h. and rename my main fin in .c instead of .cpp
It has no effect the error is the same.
The problem is that it does not fin the definition of float _Complex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not see that you are including
#include <complex.h>
see: https://www.gnu.org/software/libc/manual/html_node/Complex-Numbers.html
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried but it's not working. I use the complex.h witch is in the ..\compilers_and_libraries_2019\compilers\include\ directory
I haver also tried without the '/Qstd=c99' option and it does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wonder if your test program works with cl?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the solution from intel support
#include <stdlib.h> #include <stdio.h> #include "mkl.h" #include <math.h> int main() { /* C example, float _Complex is defined in C9X */ MKL_Complex8 x_in[32]; MKL_Complex8 x_out[32]; //float x_in[32]; //float x_out[32]; float y_in[32]; float y_out[34]; DFTI_DESCRIPTOR_HANDLE my_desc1_handle = 0; DFTI_DESCRIPTOR_HANDLE my_desc2_handle = 0; MKL_LONG status; //...put input data into x_in[0],...,x_in[31]; y_in[0],...,y_in[31] for (int i = 0; i < 32; i++) { x_in.real = cos(2 * 3.1415926535897932384626433832795*i * 4 / 32); x_in.imag = cos(2 * 3.1415926535897932384626433832795*i * 4 / 32); } status = DftiCreateDescriptor(&my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, 32); status = DftiSetValue(my_desc1_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); status = DftiCommitDescriptor(my_desc1_handle); status = DftiComputeForward(my_desc1_handle, x_in, x_out); status = DftiFreeDescriptor(&my_desc1_handle); /* result is x_out[0], ..., x_out[31]*/ status = DftiCreateDescriptor(&my_desc2_handle, DFTI_SINGLE, DFTI_REAL, 1, 32); status = DftiSetValue(my_desc2_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); status = DftiCommitDescriptor(my_desc2_handle); status = DftiComputeForward(my_desc2_handle, y_in, y_out); status = DftiFreeDescriptor(&my_desc2_handle); return status; }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where can I find mkl.h?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page