<?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 OK... I figured it out... I in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049693#M21089</link>
    <description>&lt;P&gt;OK... I figured it out... I am posting what I had done wrong here in case anyone else does the same thing.&amp;nbsp; Also, I still have&amp;nbsp;one thing that bugs me (see bottom of this comment):&lt;/P&gt;

&lt;P&gt;I found in the documentation that the default settings of the strides is not valid for 3D FFTs. &amp;nbsp;They must be set explicitly. &amp;nbsp;The third section of my code now looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;PRE class="brush:cpp;"&gt;  dim = 3;
  error_code = DftiCreateDescriptor(&amp;amp;dh, DFTI_DOUBLE, DFTI_REAL, dim, sz);
  error_code = DftiSetValue(dh, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
  rstrides[0] = 0;
  rstrides[1] = sz[1]*(sz[2]/2+1)*2;
  rstrides[2] = (sz[2]/2+1)*2;
  rstrides[3] = 1;
  error_code = DftiSetValue(dh, DFTI_INPUT_STRIDES, rstrides);
  cstrides[0] = 0;
  cstrides[1] = sz[1]*(sz[2]/2+1);
  cstrides[2] = (sz[2]/2+1);
  cstrides[3] = 1;
  error_code = DftiSetValue(dh, DFTI_OUTPUT_STRIDES, cstrides);
  error_code = DftiCommitDescriptor(dh);
  printf("error_code: %d\n", error_code);
&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;There is no error now. &amp;nbsp;:-)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;One thing still troubles me though:&amp;nbsp; It seems like if I want to do a 3D FFT, I need to ensure that the stride in the first (fastest changing) dimension is bigger (by one or two) than the size of that dimension.&amp;nbsp; That means that the input data needs to have some padding (gaps).&amp;nbsp; Is there any way around this?&amp;nbsp; It seems to me that refactoring my data to conform to this may take a significant amount of time, though I have not timed it yet... maybe it is negligible compared to the time of the FFT.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2015 18:22:00 GMT</pubDate>
    <dc:creator>jed_p_</dc:creator>
    <dc:date>2015-11-05T18:22:00Z</dc:date>
    <item>
      <title>3D DFT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049692#M21088</link>
      <description>&lt;P&gt;I am trying to do a 3D FFT in MKL 11.3, but its not working for me... most likely I am doing something wrong, but I am at a loss.&lt;/P&gt;

&lt;P&gt;I get an error when I attempt to call DftiCommitDescriptor. &amp;nbsp;I tried two different cases and got two different errors. &amp;nbsp;My code is shown below... Any help would be appreciated!&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

int main()

{

  DFTI_DESCRIPTOR_HANDLE dh;

  float *data;
  MKL_LONG sz[3];
  MKL_LONG dim = 3;
  int val;
  int error_code;

  sz[0] = 128;
  sz[1] = 128;
  sz[2] = 128;

  dim = 2;
  error_code = DftiCreateDescriptor(&amp;amp;dh, DFTI_SINGLE, DFTI_REAL, dim, sz);
  error_code = DftiCommitDescriptor(dh);
  printf("error_code: %d\n", error_code);

  dim = 3;
  error_code = DftiCreateDescriptor(&amp;amp;dh, DFTI_SINGLE, DFTI_REAL, dim, sz);
  error_code = DftiCommitDescriptor(dh);
  printf("error_code: %d\n", error_code);

  printf("%s\n", DftiErrorMessage(error_code));

  dim = 3;
  error_code = DftiCreateDescriptor(&amp;amp;dh, DFTI_SINGLE, DFTI_REAL, dim, sz);
  error_code = DftiSetValue(dh, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
  error_code = DftiCommitDescriptor(dh);
  printf("error_code: %d\n", error_code);

  printf("%s\n", DftiErrorMessage(error_code));

}
&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Note that the first call works (dim is set to 2).&lt;/P&gt;

&lt;P&gt;The second call fails (only difference is that dim is 3), indicating that the functionality is not implemented.&lt;/P&gt;

&lt;P&gt;I read in the documentation that I should use&amp;nbsp;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 13.008px; line-height: 19.512px;"&gt;DFTI_CONJUGATE_EVEN_STORAGE &amp;lt;- DFTI_COMPLEX_COMPLEX, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;so I tried this as well (third call), but it failed with the error "Inconsistent configuration parameters".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;The output I get is as follows:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;error_code: 0&lt;BR /&gt;
		error_code: 6&lt;BR /&gt;
		Intel MKL DFTI ERROR: Functionality is not implemented&lt;BR /&gt;
		error_code: 3&lt;BR /&gt;
		Intel MKL DFTI ERROR: Inconsistent configuration parameters&lt;/P&gt;

	&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 05 Nov 2015 17:44:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049692#M21088</guid>
      <dc:creator>jed_p_</dc:creator>
      <dc:date>2015-11-05T17:44:31Z</dc:date>
    </item>
    <item>
      <title>OK... I figured it out... I</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049693#M21089</link>
      <description>&lt;P&gt;OK... I figured it out... I am posting what I had done wrong here in case anyone else does the same thing.&amp;nbsp; Also, I still have&amp;nbsp;one thing that bugs me (see bottom of this comment):&lt;/P&gt;

&lt;P&gt;I found in the documentation that the default settings of the strides is not valid for 3D FFTs. &amp;nbsp;They must be set explicitly. &amp;nbsp;The third section of my code now looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;PRE class="brush:cpp;"&gt;  dim = 3;
  error_code = DftiCreateDescriptor(&amp;amp;dh, DFTI_DOUBLE, DFTI_REAL, dim, sz);
  error_code = DftiSetValue(dh, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
  rstrides[0] = 0;
  rstrides[1] = sz[1]*(sz[2]/2+1)*2;
  rstrides[2] = (sz[2]/2+1)*2;
  rstrides[3] = 1;
  error_code = DftiSetValue(dh, DFTI_INPUT_STRIDES, rstrides);
  cstrides[0] = 0;
  cstrides[1] = sz[1]*(sz[2]/2+1);
  cstrides[2] = (sz[2]/2+1);
  cstrides[3] = 1;
  error_code = DftiSetValue(dh, DFTI_OUTPUT_STRIDES, cstrides);
  error_code = DftiCommitDescriptor(dh);
  printf("error_code: %d\n", error_code);
&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;There is no error now. &amp;nbsp;:-)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;One thing still troubles me though:&amp;nbsp; It seems like if I want to do a 3D FFT, I need to ensure that the stride in the first (fastest changing) dimension is bigger (by one or two) than the size of that dimension.&amp;nbsp; That means that the input data needs to have some padding (gaps).&amp;nbsp; Is there any way around this?&amp;nbsp; It seems to me that refactoring my data to conform to this may take a significant amount of time, though I have not timed it yet... maybe it is negligible compared to the time of the FFT.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 18:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049693#M21089</guid>
      <dc:creator>jed_p_</dc:creator>
      <dc:date>2015-11-05T18:22:00Z</dc:date>
    </item>
    <item>
      <title>Hi jed,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049694#M21090</link>
      <description>&lt;P&gt;Hi jed,&lt;/P&gt;

&lt;P&gt;Padding is necessary for 3D &lt;EM&gt;real-to-complex&lt;/EM&gt; FFT. MKL does not support 'packed storage' for 3D. It also does not support real-to-real FFT.&lt;/P&gt;

&lt;P&gt;If you rearrange your data allocation so as to allow padding, you will solve the problem. And you may also get some small performance increase if you set the leading dimension to a 64-byte multiple size, e.g. instead of "&lt;CODE class="plain"&gt;rstrides[2] = (sz[2]/2+1)*2&lt;/CODE&gt;"&amp;nbsp;&amp;nbsp; set something like "&lt;CODE class="plain"&gt;rstrides[2] = UP_TO_MUL8((sz[2]/2+1)*2&lt;/CODE&gt;&amp;nbsp; )" with UP_TO_MUL8(n) defined as&amp;nbsp; ((((n)+7)/8)*8). Of course rstrides[1] should then be defined as "&lt;CODE class="plain"&gt;rstrides[1] = sz[1]*rstrides[2]&lt;/CODE&gt;" and cstrides set accordingly.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Dima&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 12:59:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049694#M21090</guid>
      <dc:creator>Dmitry_B_Intel</dc:creator>
      <dc:date>2015-11-17T12:59:22Z</dc:date>
    </item>
    <item>
      <title>Dima,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049695#M21091</link>
      <description>&lt;P&gt;Dima,&lt;/P&gt;

&lt;P&gt;Thanks so much for the great response.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:01:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/3D-DFT/m-p/1049695#M21091</guid>
      <dc:creator>jed_p_</dc:creator>
      <dc:date>2015-11-17T16:01:11Z</dc:date>
    </item>
  </channel>
</rss>

