<?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 FFT - example code gives error on setup in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078513#M22683</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;Our company is considering purchasing Intel MKL, and we have received a trail. I am however struggling to set up the descriptor for a 3d fft. When trying to commit the descriptor I get the following error:&amp;nbsp;Intel MKL DFTI ERROR: Size of one of transform dimensions exceeds 2^32 (32 bits)&lt;/P&gt;

&lt;P&gt;At first I thought that the way I set up the transform was wrong, but when I tried to run one of the examples I got the same error message. The example I tried to run is the one at the bottom of&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/522290"&gt;https://software.intel.com/en-us/node/522290&lt;/A&gt;. I am able to run a simple 1d fft based on an example I found on stackoverflow, so it seems that something strange happens when setting up the 3d fft. I'm on windows 10, and using Visual Studio 2015 with the newest version of Intel MKL.&lt;/P&gt;

&lt;P&gt;Below is the code I'm trying to run, and I've also attached a visual studio solution that should reproduce the problem, Include directories and lib-paths must be set before it can be run.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include "stdafx.h"
#include &amp;lt;vector&amp;gt;
#include &amp;lt;complex&amp;gt;
#include "mkl_dfti.h"

std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; perform_1d_fft(std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; &amp;amp;in) {
	std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; out(in.size());
	DFTI_DESCRIPTOR_HANDLE descriptor;
	MKL_LONG status;

	status = DftiCreateDescriptor(&amp;amp;descriptor, DFTI_DOUBLE, DFTI_COMPLEX, 1, in.size());
	status = DftiSetValue(descriptor, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	status = DftiCommitDescriptor(descriptor);
	status = DftiComputeForward(descriptor, in.data(), out.data());
	status = DftiFreeDescriptor(&amp;amp;descriptor);

	return out;
}


/* Example from &lt;A href="https://software.intel.com/en-us/node/522290" target="_blank"&gt;https://software.intel.com/en-us/node/522290&lt;/A&gt; */
void three_dimensional_real_fft() {
	float x[32][100][19];
	std::complex&amp;lt;float&amp;gt; y[32][100][10]; /* 10 = 19/2 + 1 */
	DFTI_DESCRIPTOR_HANDLE my_desc_handle;
	MKL_LONG status, l[3];
	MKL_LONG strides_out[4];

	//...put input data into x&lt;J&gt;&lt;K&gt;&lt;S&gt; 0&amp;lt;=j&amp;lt;=31, 0&amp;lt;=k&amp;lt;=99, 0&amp;lt;=s&amp;lt;=18
	l[0] = 32; l[1] = 100; l[2] = 19;

	strides_out[0] = 0; strides_out[1] = 1000;
	strides_out[2] = 10; strides_out[3] = 1;

	status = DftiCreateDescriptor(&amp;amp;my_desc_handle, DFTI_SINGLE,
		DFTI_REAL, 3, l);

	auto a = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle,
		DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
	auto b = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	auto c = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle,
		DFTI_OUTPUT_STRIDES, strides_out);
	auto d = DftiErrorMessage(status);

	status = DftiCommitDescriptor(my_desc_handle);
	auto e = DftiErrorMessage(status);
	status = DftiComputeForward(my_desc_handle, x, y);
	auto f = DftiErrorMessage(status);
	status = DftiFreeDescriptor(&amp;amp;my_desc_handle);
	auto g = DftiErrorMessage(status);
}

int main()
{
	std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; values = {
		std::complex&amp;lt;double&amp;gt;(1.0, 2.0),
		std::complex&amp;lt;double&amp;gt;(3.0, 4.0),
		std::complex&amp;lt;double&amp;gt;(5.0, 6.0),
		std::complex&amp;lt;double&amp;gt;(7.0, 8.0),
	};

	auto result = perform_1d_fft(values);

	three_dimensional_real_fft();
	return 0;
}
&lt;/S&gt;&lt;/K&gt;&lt;/J&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2016 11:09:28 GMT</pubDate>
    <dc:creator>Lars_J_</dc:creator>
    <dc:date>2016-09-16T11:09:28Z</dc:date>
    <item>
      <title>FFT - example code gives error on setup</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078513#M22683</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;Our company is considering purchasing Intel MKL, and we have received a trail. I am however struggling to set up the descriptor for a 3d fft. When trying to commit the descriptor I get the following error:&amp;nbsp;Intel MKL DFTI ERROR: Size of one of transform dimensions exceeds 2^32 (32 bits)&lt;/P&gt;

&lt;P&gt;At first I thought that the way I set up the transform was wrong, but when I tried to run one of the examples I got the same error message. The example I tried to run is the one at the bottom of&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/522290"&gt;https://software.intel.com/en-us/node/522290&lt;/A&gt;. I am able to run a simple 1d fft based on an example I found on stackoverflow, so it seems that something strange happens when setting up the 3d fft. I'm on windows 10, and using Visual Studio 2015 with the newest version of Intel MKL.&lt;/P&gt;

&lt;P&gt;Below is the code I'm trying to run, and I've also attached a visual studio solution that should reproduce the problem, Include directories and lib-paths must be set before it can be run.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include "stdafx.h"
#include &amp;lt;vector&amp;gt;
#include &amp;lt;complex&amp;gt;
#include "mkl_dfti.h"

std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; perform_1d_fft(std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; &amp;amp;in) {
	std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; out(in.size());
	DFTI_DESCRIPTOR_HANDLE descriptor;
	MKL_LONG status;

	status = DftiCreateDescriptor(&amp;amp;descriptor, DFTI_DOUBLE, DFTI_COMPLEX, 1, in.size());
	status = DftiSetValue(descriptor, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	status = DftiCommitDescriptor(descriptor);
	status = DftiComputeForward(descriptor, in.data(), out.data());
	status = DftiFreeDescriptor(&amp;amp;descriptor);

	return out;
}


/* Example from &lt;A href="https://software.intel.com/en-us/node/522290" target="_blank"&gt;https://software.intel.com/en-us/node/522290&lt;/A&gt; */
void three_dimensional_real_fft() {
	float x[32][100][19];
	std::complex&amp;lt;float&amp;gt; y[32][100][10]; /* 10 = 19/2 + 1 */
	DFTI_DESCRIPTOR_HANDLE my_desc_handle;
	MKL_LONG status, l[3];
	MKL_LONG strides_out[4];

	//...put input data into x&lt;J&gt;&lt;K&gt;&lt;S&gt; 0&amp;lt;=j&amp;lt;=31, 0&amp;lt;=k&amp;lt;=99, 0&amp;lt;=s&amp;lt;=18
	l[0] = 32; l[1] = 100; l[2] = 19;

	strides_out[0] = 0; strides_out[1] = 1000;
	strides_out[2] = 10; strides_out[3] = 1;

	status = DftiCreateDescriptor(&amp;amp;my_desc_handle, DFTI_SINGLE,
		DFTI_REAL, 3, l);

	auto a = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle,
		DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
	auto b = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
	auto c = DftiErrorMessage(status);
	status = DftiSetValue(my_desc_handle,
		DFTI_OUTPUT_STRIDES, strides_out);
	auto d = DftiErrorMessage(status);

	status = DftiCommitDescriptor(my_desc_handle);
	auto e = DftiErrorMessage(status);
	status = DftiComputeForward(my_desc_handle, x, y);
	auto f = DftiErrorMessage(status);
	status = DftiFreeDescriptor(&amp;amp;my_desc_handle);
	auto g = DftiErrorMessage(status);
}

int main()
{
	std::vector&amp;lt;std::complex&amp;lt;double&amp;gt;&amp;gt; values = {
		std::complex&amp;lt;double&amp;gt;(1.0, 2.0),
		std::complex&amp;lt;double&amp;gt;(3.0, 4.0),
		std::complex&amp;lt;double&amp;gt;(5.0, 6.0),
		std::complex&amp;lt;double&amp;gt;(7.0, 8.0),
	};

	auto result = perform_1d_fft(values);

	three_dimensional_real_fft();
	return 0;
}
&lt;/S&gt;&lt;/K&gt;&lt;/J&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2016 11:09:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078513#M22683</guid>
      <dc:creator>Lars_J_</dc:creator>
      <dc:date>2016-09-16T11:09:28Z</dc:date>
    </item>
    <item>
      <title>Hi Lars,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078514#M22684</link>
      <description>&lt;P&gt;Hi Lars,&lt;/P&gt;

&lt;P&gt;I could not reproduce your problem. Please make sure you link with MKL library file correctly. Have you ever tried to compile with commend lines? Please try to compile with command lines in "Compiler 17.0 for Intel 64/IA32 VisualStudio 14.0" to check if this problem is caused by linkage problem.&lt;/P&gt;

&lt;P&gt;For Intel Compiler&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&amp;gt;icl IntelMKLApp.cpp -Qmkl&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;or for microsoft compiler&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&amp;gt;cl IntelMKLApp.cpp &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;-I"%MKLROOT%"\include&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;mkl_intel_lp64.lib mkl_core.lib mkl_sequential.lib&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2016 07:09:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078514#M22684</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2016-09-18T07:09:01Z</dc:date>
    </item>
    <item>
      <title>Hi Fiona,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078515#M22685</link>
      <description>&lt;P&gt;Hi Fiona,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. It turned out that this happened because I was trying to link against too many .lib files. When I only had mkl_rt.lib as additional dependency in my visual studio project (Properties -&amp;gt; Linker -&amp;gt; Input), everything worked just fine.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 13:51:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-example-code-gives-error-on-setup/m-p/1078515#M22685</guid>
      <dc:creator>Lars_J_</dc:creator>
      <dc:date>2016-09-20T13:51:36Z</dc:date>
    </item>
  </channel>
</rss>

