<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mult-transform FFT only computes half the points in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1392969#M33285</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As described by me and another person in a &lt;A href="http://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-in-multi-transforms-with-mkl-dft1d/m-p/1391853#M33270" target="_self"&gt;similar thread&lt;/A&gt; , there's something going on with multi-dimensional transforms.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my full example:&lt;/P&gt;
&lt;P&gt;test_intel.cpp:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;fstream&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;complex&amp;gt;

int main(void)
{
    int rangePoints = 1024;
    int rxNum = 8;

    std::vector&amp;lt;double&amp;gt; inputData(rxNum * rangePoints, 0.0);

    // Using MKL_Complex16 yields the same result
    std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; spectrum(rangePoints * rxNum);

    std::ifstream file("input.txt", std::ifstream::binary);

    file.read(reinterpret_cast&amp;lt;char *&amp;gt;(inputData.data()), sizeof(double) * rxNum * rangePoints);
    // At this point, input data contains 8 arrays in one, row-major.

    DFTI_DESCRIPTOR_HANDLE rangeHandle;

    auto status = DftiCreateDescriptor(&amp;amp;rangeHandle, DFTI_DOUBLE, DFTI_REAL, 1, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_NUMBER_OF_TRANSFORMS, rxNum);
    status = DftiSetValue(rangeHandle, DFTI_INPUT_DISTANCE, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_OUTPUT_DISTANCE, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
    status = DftiCommitDescriptor(rangeHandle);


    DftiComputeForward(rangeHandle, inputData.data(), spectrum.data());

    // Print a few entries to illustrate the point
    // As you will see from the output, half of the data is missing
    for (int i = 0; i &amp;lt; rxNum; i++)
    {
        std::cout &amp;lt;&amp;lt; "RX: " &amp;lt;&amp;lt; i + 1 &amp;lt;&amp;lt; ", Points: ";
        for (int j = 0; j &amp;lt; 10; j++)
        {
            std::cout &amp;lt;&amp;lt; spectrum[rangePoints * i + j] &amp;lt;&amp;lt; " ";
        }
        std::cout &amp;lt;&amp;lt; "\n";
    }

    DftiFreeDescriptor(&amp;amp;rangeHandle);
    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CMakeLists.txt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;cmake_minimum_required(VERSION 3.15)

project(test_intel LANGUAGES CXX)

add_executable(test_intel test_intel.cpp)
find_package(MKL CONFIG REQUIRED)
target_link_libraries(test_intel PRIVATE MKL::MKL)

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm attaching the input file mentioned in the code as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that I only get meaningful data for half of the arrays, the rest of data is zero.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2022 09:18:52 GMT</pubDate>
    <dc:creator>sudoLife</dc:creator>
    <dc:date>2022-06-16T09:18:52Z</dc:date>
    <item>
      <title>Mult-transform FFT only computes half the points</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1392969#M33285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As described by me and another person in a &lt;A href="http://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-in-multi-transforms-with-mkl-dft1d/m-p/1391853#M33270" target="_self"&gt;similar thread&lt;/A&gt; , there's something going on with multi-dimensional transforms.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my full example:&lt;/P&gt;
&lt;P&gt;test_intel.cpp:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;fstream&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;complex&amp;gt;

int main(void)
{
    int rangePoints = 1024;
    int rxNum = 8;

    std::vector&amp;lt;double&amp;gt; inputData(rxNum * rangePoints, 0.0);

    // Using MKL_Complex16 yields the same result
    std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; spectrum(rangePoints * rxNum);

    std::ifstream file("input.txt", std::ifstream::binary);

    file.read(reinterpret_cast&amp;lt;char *&amp;gt;(inputData.data()), sizeof(double) * rxNum * rangePoints);
    // At this point, input data contains 8 arrays in one, row-major.

    DFTI_DESCRIPTOR_HANDLE rangeHandle;

    auto status = DftiCreateDescriptor(&amp;amp;rangeHandle, DFTI_DOUBLE, DFTI_REAL, 1, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_NUMBER_OF_TRANSFORMS, rxNum);
    status = DftiSetValue(rangeHandle, DFTI_INPUT_DISTANCE, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_OUTPUT_DISTANCE, rangePoints);
    status = DftiSetValue(rangeHandle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
    status = DftiCommitDescriptor(rangeHandle);


    DftiComputeForward(rangeHandle, inputData.data(), spectrum.data());

    // Print a few entries to illustrate the point
    // As you will see from the output, half of the data is missing
    for (int i = 0; i &amp;lt; rxNum; i++)
    {
        std::cout &amp;lt;&amp;lt; "RX: " &amp;lt;&amp;lt; i + 1 &amp;lt;&amp;lt; ", Points: ";
        for (int j = 0; j &amp;lt; 10; j++)
        {
            std::cout &amp;lt;&amp;lt; spectrum[rangePoints * i + j] &amp;lt;&amp;lt; " ";
        }
        std::cout &amp;lt;&amp;lt; "\n";
    }

    DftiFreeDescriptor(&amp;amp;rangeHandle);
    return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CMakeLists.txt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;cmake_minimum_required(VERSION 3.15)

project(test_intel LANGUAGES CXX)

add_executable(test_intel test_intel.cpp)
find_package(MKL CONFIG REQUIRED)
target_link_libraries(test_intel PRIVATE MKL::MKL)

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm attaching the input file mentioned in the code as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that I only get meaningful data for half of the arrays, the rest of data is zero.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 09:18:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1392969#M33285</guid>
      <dc:creator>sudoLife</dc:creator>
      <dc:date>2022-06-16T09:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Mult-transform FFT only computes half the points</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1394053#M33301</link>
      <description>&lt;P&gt;I found the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, a bit of background: in real-to-complex FFTs, only half of the points are computed. The rest can be reconstructed from the first half due to conjugate-even symmetry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem in my example is the &lt;STRONG&gt;&lt;EM&gt;DFTI_CONJUGATE_EVEN_STORAGE&lt;/EM&gt;&lt;/STRONG&gt; setting, which by default is set to the deprecated &lt;EM&gt;&lt;STRONG&gt;DFTI_COMPLEX_REAL&lt;/STRONG&gt;.&lt;/EM&gt; And my output array elements are &lt;EM&gt;&lt;STRONG&gt;std::complex&amp;lt;double&amp;gt;&lt;/STRONG&gt;&lt;/EM&gt;, so I ended up with garbage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Solution: set &lt;EM&gt;&lt;STRONG&gt;DFTI_CONJUGATE_EVEN_STORAGE&lt;/STRONG&gt;&lt;/EM&gt; to &lt;STRONG&gt;DFTI_COMPLEX_COMPLEX&lt;/STRONG&gt;. Check &lt;A href="https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/fourier-transform-functions/fft-functions/configuration-settings/dfti-complex-real-conj-even-storage.html" target="_self"&gt;this link&lt;/A&gt;&amp;nbsp; for more information.&lt;/P&gt;
&lt;P&gt;Remember, you still need to reconstruct the second halves of the output arrays if you need them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The rest of the code doesn't need to be changed. So, that's all there is to the story.&amp;nbsp; &lt;STRONG&gt;Intel, you really need to stop setting deprecated parameter values as defaults.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 06:35:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1394053#M33301</guid>
      <dc:creator>sudoLife</dc:creator>
      <dc:date>2022-06-21T06:35:40Z</dc:date>
    </item>
    <item>
      <title>Re:Mult-transform FFT only computes half the points</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1394119#M33303</link>
      <description>&lt;P&gt;Hi sudoLife,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Glad to know that your issue was resolved. Thanks for sharing the solution with us. &lt;/P&gt;&lt;P&gt;We would like to inform you, Although DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_REAL is the default setting for the DFTI_REAL forward domain, we must avoid using this storage scheme. This storage scheme is deprecated for one-dimensional transforms and the default will change in a &lt;STRONG&gt;future release&lt;/STRONG&gt;. For two-dimensional transforms, this storage scheme is deprecated, support will be removed, and the default will change in a future release as well.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jun 2022 10:15:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Mult-transform-FFT-only-computes-half-the-points/m-p/1394119#M33303</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2022-06-21T10:15:14Z</dc:date>
    </item>
  </channel>
</rss>

