<?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 Re: why passing DFTI_SINGLE into DftiCreateDescriptor gives garbage values? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/why-passing-DFTI-SINGLE-into-DftiCreateDescriptor-gives-garbage/m-p/1605119#M36203</link>
    <description>&lt;P&gt;Please close this post.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jun 2024 17:47:36 GMT</pubDate>
    <dc:creator>raavi</dc:creator>
    <dc:date>2024-06-09T17:47:36Z</dc:date>
    <item>
      <title>why passing DFTI_SINGLE into DftiCreateDescriptor gives garbage values?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/why-passing-DFTI-SINGLE-into-DftiCreateDescriptor-gives-garbage/m-p/1604815#M36195</link>
      <description>&lt;P&gt;I have two questions.&lt;/P&gt;&lt;P&gt;1) why, when passing DFTI_SINGLE into &lt;SPAN&gt;DftiCreateDescriptor gives garbage values?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2) Though passing DFTI_DOUBLE into &lt;SPAN&gt;DftiCreateDescriptor gives sane values but the output does not match with Octave output.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;MKL_LONG status;
DFTI_DESCRIPTOR_HANDLE backward_handle_2d = NULL;
MKL_Complex16 *fourier_2d_mkl       	  = NULL;        

MKL_LONG dims[2];

dims[0] 		= 2;
dims[1] 		= 23;

int count_2d    = dims[0]*dims[1];

status  		= DftiCreateDescriptor(&amp;amp;backward_handle_2d, DFTI_DOUBLE, DFTI_COMPLEX, 2, dims);
status  		= DftiCommitDescriptor(backward_handle_2d);



fourier_2d_mkl  = (MKL_Complex16*)mkl_malloc(count_2d * sizeof(MKL_Complex16), 64);

for (int i=0; i&amp;lt;count_2d; i++)
    { fourier_2d_mkl[i].real = 0.0; fourier_2d_mkl[i].imag = 0.0; }

fourier_2d_mkl[0].real  = -2.642292567870791e-17; fourier_2d_mkl[0].imag  =  2.457213459869541e-17;
fourier_2d_mkl[1].real  =  3.394204453993388e-15; fourier_2d_mkl[1].imag  =  6.465292243826133e-14;     
fourier_2d_mkl[2].real  =  7.250014158956356e-13; fourier_2d_mkl[2].imag  = -4.363287473914971e-12;
fourier_2d_mkl[3].real  = -1.428607589482790e-10; fourier_2d_mkl[3].imag  =  1.188079301204293e-10;    
fourier_2d_mkl[4].real  =  6.952990293826207e-09; fourier_2d_mkl[4].imag  =  7.124671255671636e-10;
fourier_2d_mkl[5].real  = -1.247732021241605e-07; fourier_2d_mkl[5].imag  = -1.525550389367994e-07;    
fourier_2d_mkl[6].real  = -3.680801028326798e-07; fourier_2d_mkl[6].imag  =  3.686621541467887e-06;    
fourier_2d_mkl[7].real  =  2.677103698936326e-05; fourier_2d_mkl[7].imag  = -2.208311063252299e-05;
fourier_2d_mkl[8].real  =  3.310982970348360e-06; fourier_2d_mkl[8].imag  =  4.060528725376024e-06;

fourier_2d_mkl[15].real  =  2.701945410474277e-05;fourier_2d_mkl[15].imag  = -2.177772108929361e-05;
fourier_2d_mkl[16].real =  3.685365224055048e-06; fourier_2d_mkl[16].imag =  3.817322139893435e-07;        
fourier_2d_mkl[17].real =  1.243931716409880e-07; fourier_2d_mkl[17].imag =  1.528359352830827e-07;
fourier_2d_mkl[18].real = -7.210215362767208e-10; fourier_2d_mkl[18].imag =  6.961508659626094e-09;    
fourier_2d_mkl[19].real = -1.449335800029190e-10; fourier_2d_mkl[19].imag =  1.184786074831728e-10;
fourier_2d_mkl[20].real = -4.345677649234239e-12; fourier_2d_mkl[20].imag = -8.023045583080176e-13;
fourier_2d_mkl[21].real = -2.174238868343064e-15; fourier_2d_mkl[21].imag = -6.468023321689881e-14;
fourier_2d_mkl[22].real = -2.648066946353768e-17; fourier_2d_mkl[22].imag = -2.943784428508000e-17;

fourier_2d_mkl[23].real = -1.647039786289660e-14; fourier_2d_mkl[23].imag =  1.531673055823963e-14;
fourier_2d_mkl[24].real =  9.328254025265415e-13; fourier_2d_mkl[24].imag =  1.660593228562294e-11;
fourier_2d_mkl[25].real =  9.970878341165177e-11; fourier_2d_mkl[25].imag = -4.852415762764660e-10;
fourier_2d_mkl[26].real = -7.587349566415179e-09; fourier_2d_mkl[26].imag =  5.641756309256826e-09;        
fourier_2d_mkl[27].real =  1.569897070996509e-07; fourier_2d_mkl[27].imag =  2.418811983812866e-08;
fourier_2d_mkl[28].real = -1.184957370080801e-06; fourier_2d_mkl[28].imag = -1.607459905410108e-06;
fourier_2d_mkl[29].real = -2.422333576942743e-06; fourier_2d_mkl[29].imag =  1.649413356788869e-05;
fourier_2d_mkl[30].real =  5.397110486561100e-05; fourier_2d_mkl[30].imag = -4.182910800968701e-05;
fourier_2d_mkl[31].real =  1.389085535845420e-05; fourier_2d_mkl[31].imag =  1.904852960287619e-05;

fourier_2d_mkl[38].real =  5.632425140135355e-05; fourier_2d_mkl[38].imag = -3.860245232056857e-05;
fourier_2d_mkl[39].real =  1.644525380084373e-05; fourier_2d_mkl[39].imag =  2.735362516264706e-06;
fourier_2d_mkl[40].real =  1.168718667543190e-06; fourier_2d_mkl[40].imag =  1.619167661329656e-06;
fourier_2d_mkl[41].real = -2.520504976062189e-08; fourier_2d_mkl[41].imag =  1.569498873744191e-07;
fourier_2d_mkl[42].real = -7.685758628322245e-09; fourier_2d_mkl[42].imag =  5.594175098567900e-09;
fourier_2d_mkl[43].real = -4.829524388709853e-10; fourier_2d_mkl[43].imag = -1.083259323876055e-10;
fourier_2d_mkl[44].real = -6.194460301224245e-13; fourier_2d_mkl[44].imag = -1.661409550202508e-11;
fourier_2d_mkl[45].real = -1.650639172375137e-14; fourier_2d_mkl[45].imag = -1.834970939618425e-14;

status  		= DftiComputeBackward(backward_handle_2d, fourier_2d_mkl);
status  		= DftiFreeDescriptor(&amp;amp;backward_handle_2d);         

int K   		= 8;

for (int j=0; j&amp;lt;dims[0]; j++)
{
    for (int i=0; i&amp;lt;dims[1]; i++)
    {
        int index  = i + ( j * dims[1] );        
        double phi = (2.0 * pi * i) / static_cast&amp;lt;double&amp;gt;(dims[1]);            

        std::complex&amp;lt;double&amp;gt; signal(fourier_2d_mkl[index].real, fourier_2d_mkl[index].imag);            

        std::complex&amp;lt;double&amp;gt; output = Internal::complex_multiply(signal, Internal::expi(-K * phi));         

        std::cout &amp;lt;&amp;lt;std::left &amp;lt;&amp;lt;output.real() &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt;output.imag()&amp;lt;&amp;lt;std::endl;
    }
    std::cout &amp;lt;&amp;lt; std::endl;
}             

mkl_free(fourier_2d_mkl);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Jun 2024 10:59:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/why-passing-DFTI-SINGLE-into-DftiCreateDescriptor-gives-garbage/m-p/1604815#M36195</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-06-07T10:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: why passing DFTI_SINGLE into DftiCreateDescriptor gives garbage values?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/why-passing-DFTI-SINGLE-into-DftiCreateDescriptor-gives-garbage/m-p/1605119#M36203</link>
      <description>&lt;P&gt;Please close this post.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 17:47:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/why-passing-DFTI-SINGLE-into-DftiCreateDescriptor-gives-garbage/m-p/1605119#M36203</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-06-09T17:47:36Z</dc:date>
    </item>
  </channel>
</rss>

