<?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 The sample program doesn't work. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-sample-program-doesn-t-work/m-p/902010#M11329</link>
    <description>&lt;P&gt;I made a code that looked a sample code.&lt;/P&gt;
&lt;P&gt;The small size(100X40) was worked. but The big size(2560X3072) was not worked.&lt;/P&gt;
&lt;P&gt;Are there bugs in a code?&lt;/P&gt;
&lt;P&gt;Here are sample code that I edited.&lt;/P&gt;
&lt;P&gt;void BoolLib::Run4()//&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;int Level_limit =5;&lt;/P&gt;
&lt;P&gt;int i,j;&lt;/P&gt;
&lt;P&gt;_complex** x;&lt;/P&gt;
&lt;P&gt;float** y;&lt;/P&gt;
&lt;P&gt;y = new float* [3074];&lt;/P&gt;
&lt;P&gt;for(i=0; i&amp;lt;3074; i++) y&lt;I&gt; = new float[2562];&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;x = new _complex* [3072];&lt;/P&gt;
&lt;P&gt;for(i=0; i&amp;lt;3072; i++) x&lt;I&gt; = new _complex[2560];&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;int Height_f = 3072;&lt;/P&gt;
&lt;P&gt;int Widtht_f = 2560;&lt;/P&gt;
&lt;P&gt;DFTI_DESCRIPTOR_HANDLE my_desc1_handle;&lt;/P&gt;
&lt;P&gt;DFTI_DESCRIPTOR_HANDLE my_desc2_handle;&lt;/P&gt;
&lt;P&gt;MKL_LONG status;&lt;/P&gt;
&lt;P&gt;MKL_LONG l[2];&lt;/P&gt;
&lt;P&gt;l[0] = Height_f, l[1] = Widtht_f;&lt;/P&gt;
&lt;P&gt;for(i=0; i&lt;HEIGHT_F&gt;
&lt;/HEIGHT_F&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;for(j=0; j&lt;WIDTHT_F&gt;
&lt;/WIDTHT_F&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;x&lt;I&gt;&lt;J&gt;.x = 0.0;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;x&lt;I&gt;&lt;J&gt;.y = 0.0;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;for(i=0; i&amp;lt;(Height_f+2); i++)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;for(j=0; j&amp;lt;(Widtht_f+2); j++)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;y&lt;I&gt;&lt;J&gt; = 0.0;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;for(i=0; i&lt;HEIGHT_F&gt;
&lt;/HEIGHT_F&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;for(j=0; j&lt;WIDTHT_F&gt;
&lt;/WIDTHT_F&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;if((j%10) == 0)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;x&lt;I&gt;&lt;J&gt;.x = 200.0;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;float src;&lt;/P&gt;
&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;
&lt;P&gt;status = DftiCreateDescriptor( &amp;amp;my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Height_f);&lt;/P&gt;
&lt;P&gt;status = DftiCreateDescriptor( &amp;amp;my_desc2_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Widtht_f);&lt;/P&gt;
&lt;P&gt;l[0] = 0, l[1] = Widtht_f;&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_NUMBER_OF_TRANSFORMS, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, 1);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, 1);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_STRIDES, l);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_STRIDES, l);&lt;/P&gt;
&lt;P&gt;status = DftiCommitDescriptor( my_desc1_handle);&lt;/P&gt;
&lt;P&gt;status = DftiComputeForward( my_desc1_handle, x);&lt;/P&gt;
&lt;P&gt;//////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;
&lt;P&gt;l[0] = 0, l[1] = Height_f;&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc2_handle, DFTI_NUMBER_OF_TRANSFORMS, Height_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiCommitDescriptor( my_desc2_handle);&lt;/P&gt;
&lt;P&gt;status = DftiComputeForward( my_desc2_handle, x);&lt;/P&gt;
&lt;P&gt;status = DftiFreeDescriptor( &amp;amp;my_desc1_handle);&lt;/P&gt;
&lt;P&gt;status = DftiFreeDescriptor( &amp;amp;my_desc2_handle);&lt;/P&gt;
&lt;P&gt;delete [] x;&lt;/P&gt;
&lt;P&gt;delete [] y;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2010 01:55:13 GMT</pubDate>
    <dc:creator>siinii</dc:creator>
    <dc:date>2010-02-04T01:55:13Z</dc:date>
    <item>
      <title>The sample program doesn't work.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-sample-program-doesn-t-work/m-p/902010#M11329</link>
      <description>&lt;P&gt;I made a code that looked a sample code.&lt;/P&gt;
&lt;P&gt;The small size(100X40) was worked. but The big size(2560X3072) was not worked.&lt;/P&gt;
&lt;P&gt;Are there bugs in a code?&lt;/P&gt;
&lt;P&gt;Here are sample code that I edited.&lt;/P&gt;
&lt;P&gt;void BoolLib::Run4()//&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;int Level_limit =5;&lt;/P&gt;
&lt;P&gt;int i,j;&lt;/P&gt;
&lt;P&gt;_complex** x;&lt;/P&gt;
&lt;P&gt;float** y;&lt;/P&gt;
&lt;P&gt;y = new float* [3074];&lt;/P&gt;
&lt;P&gt;for(i=0; i&amp;lt;3074; i++) y&lt;I&gt; = new float[2562];&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;x = new _complex* [3072];&lt;/P&gt;
&lt;P&gt;for(i=0; i&amp;lt;3072; i++) x&lt;I&gt; = new _complex[2560];&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;int Height_f = 3072;&lt;/P&gt;
&lt;P&gt;int Widtht_f = 2560;&lt;/P&gt;
&lt;P&gt;DFTI_DESCRIPTOR_HANDLE my_desc1_handle;&lt;/P&gt;
&lt;P&gt;DFTI_DESCRIPTOR_HANDLE my_desc2_handle;&lt;/P&gt;
&lt;P&gt;MKL_LONG status;&lt;/P&gt;
&lt;P&gt;MKL_LONG l[2];&lt;/P&gt;
&lt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////////////////////////////////////////////&lt;/P&gt;
&lt;P&gt;status = DftiCreateDescriptor( &amp;amp;my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Height_f);&lt;/P&gt;
&lt;P&gt;status = DftiCreateDescriptor( &amp;amp;my_desc2_handle, DFTI_SINGLE, DFTI_COMPLEX, 1, Widtht_f);&lt;/P&gt;
&lt;P&gt;l[0] = 0, l[1] = Widtht_f;&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_NUMBER_OF_TRANSFORMS, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, 1);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, 1);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_STRIDES, l);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_STRIDES, l);&lt;/P&gt;
&lt;P&gt;status = DftiCommitDescriptor( my_desc1_handle);&lt;/P&gt;
&lt;P&gt;status = DftiComputeForward( my_desc1_handle, x);&lt;/P&gt;
&lt;P&gt;//////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;
&lt;P&gt;l[0] = 0, l[1] = Height_f;&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc2_handle, DFTI_NUMBER_OF_TRANSFORMS, Height_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_INPUT_DISTANCE, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiSetValue(my_desc1_handle, DFTI_OUTPUT_DISTANCE, Widtht_f);&lt;/P&gt;
&lt;P&gt;status = DftiCommitDescriptor( my_desc2_handle);&lt;/P&gt;
&lt;P&gt;status = DftiComputeForward( my_desc2_handle, x);&lt;/P&gt;
&lt;P&gt;status = DftiFreeDescriptor( &amp;amp;my_desc1_handle);&lt;/P&gt;
&lt;P&gt;status = DftiFreeDescriptor( &amp;amp;my_desc2_handle);&lt;/P&gt;
&lt;P&gt;delete [] x;&lt;/P&gt;
&lt;P&gt;delete [] y;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 01:55:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-sample-program-doesn-t-work/m-p/902010#M11329</guid>
      <dc:creator>siinii</dc:creator>
      <dc:date>2010-02-04T01:55:13Z</dc:date>
    </item>
    <item>
      <title>The sample program doesn't work.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-sample-program-doesn-t-work/m-p/902011#M11330</link>
      <description>&lt;P&gt;Hi siinii,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You probably did the small size on a static array, defined as x[100][40]. The way the dynamic array is arranged in your exampleis incorrect and it demonstrates typical mistake. For static array '_complex x&lt;M&gt;&lt;N&gt;' expression 'x' has type '_complex *' whereas for dynamic array that one would use with double-subscript notation 'x&lt;I&gt;&lt;J&gt;' the type of 'x' is '_complex**' that is pointer to pointers. In other words, in this example when you call DftiComputeForward(..., x) the input data to the FFT routine is pointers, not the complex numbers!&lt;/J&gt;&lt;/I&gt;&lt;/N&gt;&lt;/M&gt;&lt;/P&gt;
&lt;P&gt;I'd suggest you to refrain from the practice of using double-subscript notation for dynamic arrays, and adoptthe following usage instead:&lt;/P&gt;
&lt;P&gt;const int ROWS=3072, COLS=2560;&lt;BR /&gt;const int ROWSIZE=COLS, COLSIZE=ROWS;&lt;BR /&gt;_complex *x = new _complex[ROWS*COLS];&lt;BR /&gt;#define x(r,c) x[*ROWSIZE+(c)] /* explicit row-major indexing */&lt;BR /&gt;memset(x,0,sizeof(x[0])*ROWS*COLS); /* zero fill initialization */&lt;BR /&gt;for (r=0;r&lt;ROWS&gt;
&lt;/ROWS&gt;&lt;/P&gt;&lt;P&gt;The rest of this reply is duplicating your example in the above terms.&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(rowfft,DFTI_SINGLE,DFTI_COMPLEX,1,ROWSIZE); /* stride 1 by default */&lt;BR /&gt;DftiSetValue(rowfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)ROWS);&lt;BR /&gt;DftiSetValue(rowfft,DFTI_INPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;BR /&gt;DftiSetValue(rowfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(colfft,DFTI_SINGLE,DFTI_COMPLEX,1,COLSIZE); /* will setstrides */&lt;BR /&gt;MKL_LONG colfft_strides[] = { 0,ROWSIZE };&lt;BR /&gt;DftiSetValue(colfft,DFTI_INPUT_STRIDES,colfft_strides);&lt;BR /&gt;DftiSetValue(colfft,DFTI_OUTPUT_STRIDES,colfft_strides);&lt;BR /&gt;DftiSetValue(colfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)COLS);&lt;BR /&gt;DftiSetValue(colfft,DFTI_INPUT_DISTANCE,(MKL_LONG)1);&lt;BR /&gt;DftiSetValue(colfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)1);&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;DftiComputeForward(rowfft,x);&lt;BR /&gt;DftiComputeForward(colfft,x);&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Dima&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 04:20:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-sample-program-doesn-t-work/m-p/902011#M11330</guid>
      <dc:creator>Dmitry_B_Intel</dc:creator>
      <dc:date>2010-02-04T04:20:46Z</dc:date>
    </item>
  </channel>
</rss>

