I am following the oneMKL 2D FFT code examples to perform a real to complex forward transform in-place. However, after the transform has been computed, the data does not appear to have changed. No errors are produced.
Attempting to upload the code on this site as a .cpp or even .txt file gives the error :
"The attachment's main.cpp/.txt content type (text/plain) does not match its file extension and has been removed."
I have instead uploaded the C++ code and CMakeLists here.
Any help is much appreciated.
Thanks for posting on Intel Communities.
We have tried running the code in our environment and we could see the results being printed as well. Could you please let us know your environment details?
Thank you for your response. I am using Qt Creator 8.0.1 with Qt 6.4.0 MSVC2019 64bit and the following environment variables:
-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe
-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/mkl_test
-DMKL_DIR:PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/lib/cmake/mkl
-DMKL_H:PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/include
-DOMP_DLL_DIR:PATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/../../compiler/latest/windows/redist/intel64_win/compiler
-DOMP_LIBRARY:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win/libiomp5md.lib
-Dmkl_core_file:STRING=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/lib/intel64/mkl_core_dll.lib
-Dmkl_intel_ilp64_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/lib/intel64/mkl_intel_ilp64_dll.lib
-Dmkl_intel_thread_file:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/mkl/2022.2.0/lib/intel64/mkl_intel_thread_dll.lib
Your output indeed looks correct. I have attached my output for the 2D FFT in question but also for a 1D FFT with similar code which manages to produce the expected result. The code for the 1D FFT is also attached.
Could you please try compiling and running the code on Intel oneAPI command prompt and check for the results?
Please refer to the below link for more information regarding running the sample project using the command line.
Hi again Shanmukh,
The transform indeed works when using the oneAPI command prompt to build and run the program. However, I still need to work out how to use the code through my IDE, as I want to integrate it with a larger project. Even when running Qt Creator through the oneAPI command prompt, the 2D FFT does not seem to work, while the 1D FFT still works. Do you have ideas for, what I could try?
A gentle reminder:
We have not heard back from you. Has the information provided helped? Kindly let us know if we could help you further.
Could you please refer to the below link details about hardware, operating system, and software prerequisites for the Intel® oneAPI Math Kernel Library.
I see that Qt Creator is not officially supported. However, when building with CMake in Visual Studio 2019, I get the same issue. However if built with nmake and run through the CLI, everything works as expected. So what could I try to make it work with CMake?
I found out that the statuses returned DftiCommitDescriptor and DftiComputeForward are different depending on whether I use nmake or CMake.
Building with nmake I get:
status = DftiCreateDescriptor(&my_desc_handle, DFTI_SINGLE, DFTI_REAL, 2, dim_sizes); status = 0 status = DftiCommitDescriptor(my_desc_handle); status = 0 status = DftiComputeForward(my_desc_handle, r2c_data); status = 0 status = DftiFreeDescriptor(&my_desc_handle); status = 0
While building with CMake I get:
status = DftiCreateDescriptor(&my_desc_handle, DFTI_SINGLE, DFTI_REAL, 2, dim_sizes); status = 0 status = DftiCommitDescriptor(my_desc_handle); status = 9 status = DftiComputeForward(my_desc_handle, r2c_data); status = 2 status = DftiFreeDescriptor(&my_desc_handle); status = 0
I cannot seem to find any documentation for these status values. Perhaps you could explain what they mean?
Could you please refresh the page and check for the screenshot? Below are various types of predefined error statuses.
|0||DFTI_NO_ERROR||No error. The zero status belongs to this class.|
|1||DFTI_MEMORY_ERROR||Usually associated with memory allocation.|
|2||DFTI_INVALID_CONFIGURATION||Invalid settings in one or more configuration parameters.|
|3||DFTI_INCONSISTENT_CONFIGURATION||Inconsistent configuration or input parameters.|
of OMP threads in the computation function is
not equal to the number of OMP threads in the initialization stage (commit function).
|5||DFTI_MULTITHREADED_ERROR||Usually associated with a value that OMP routines return in case of errors.|
|6||DFTI_BAD_DESCRIPTOR||Descriptor is unusable for computation.|
|7||DFTI_UNIMPLEMENTED||Unimplemented legitimate settings; implementation dependent.|
|8||DFTI_MKL_INTERNAL_ERROR||Internal library error.|
|9||DFTI_1D_LENGTH_EXCEEDS_INT32||Length of one of the dimensions exceeds 232 -1 (4bytes).|
|9||DFTI_1D_MEMORY_EXCEEDS_INT32||Data size of one of the transforms exceeds 231 -1 bytes.|
You could also go through the below link for more details regarding the same.
Thank you for the error codes. According to these, it seems that the length of a dimension in the 30x30 transform exceeds 2E32.
By the way, the latest screenshot you sent was of the 1D FFT code which I said ran fine in my environment.
Anyways, I have the corresponding example working using the FFTW3 interface, so I will be sticking to that.
I have the corresponding example working using the FFTW3 interface, so I will be sticking to that.
>> Thanks for sharing with us the details. As your issue has been resolved, Could you please let us know if we could close this case at our end?
Thanks for the confirmation! If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Have a great day!