Performing an FFT using C++ AMP
-
Friday, October 21, 2011 2:29 PM
In Direct3D we have the ability to perform 1, 2 or 3D FFTs using the D3DX11CreateFFTxxx etc.
Is there a way to access this functionality when using C++ AMP or do I have to write my own code in a kernal to implement the calculation?
Thanks in Advance
Mark
All Replies
-
Friday, October 21, 2011 10:29 PM
Ah the FFT, yes there is some calls in Direct3D, but I probably could conjure up something in a few weeks
I recall Fourier analysis from an old honors math class I took, it focused on the wave equation
Read the manuals for DirectX if that API is all you need
Windows MVP 2010-11, XP, Vista, 7. Expanding into Windows Server 2008 R2, SQL Server, SharePoint, Cloud, Virtualization etc. etc.
Hardcore Games, Legendary is the only Way to Play
Developer | Windows IT | Chess | Economics | Vegan Advocate | PC Reviews
-
Friday, October 21, 2011 10:34 PMOwner
Hi Mark,
The D3D FFT functions can't be directly used from a C++ AMP kernel.
I haven't tried this, but since ID3DDX11FFT interface operates on unordered access views, it should be possible to perform these FFT transformations outside of a kernel, and then use these UAV's to create C++ AMP arrays to do further computations on. If you try this, let us know how it works.
Thanks.
++don;- Marked As Answer by PTRMark Saturday, October 22, 2011 1:53 AM
-
Saturday, October 22, 2011 1:52 AM
Don,
Thanks for the suggestion - it didn't occur to me to mix DirectCompute and C++ AMP in the same application.
Kind Regards
Mark
-
Saturday, October 22, 2011 3:45 AM
Don,
I am not aware of mixing DirectCompute & AMP either. The application I am working on involves lots of Texture2D and UAVs, which are not directly supported in C++ AMP. Could you elaborate on the approach of mixing C++ AMP & DirectCompute, or even show some code examples?
Thanks!
lakeeast
-
Saturday, October 22, 2011 6:36 PM
Hi Mark & lakeeast,
If you look at discussion here: http://social.msdn.microsoft.com/Forums/en-US/parallelcppnative/thread/b6e8f31e-723b-4eeb-8b4e-6a6ee5e756f3
It talks a little bit about the interop support between C++ AMP and Direct3D (not just DirectCompute). The main requirement is that the C++ Array and ID3D11Buffer can interop only if the buffer is a structured buffer with stride of 4 bytes. In the preview bits, there are some other requirements that we are looking to relax.
Thanks,
Weirong
- Proposed As Answer by DanielMothMicrosoft Employee, Owner Monday, October 24, 2011 9:09 PM
-
Friday, November 18, 2011 2:29 AMOwner
Mark, we now have a wrapper for FFT which means you do not need to do the interop yourself, so please check it out:
http://blogs.msdn.com/b/nativeconcurrency/archive/2011/11/15/the-c-amp-fft-library.aspx
http://www.danielmoth.com/Blog/- Marked As Answer by DanielMothMicrosoft Employee, Owner Wednesday, April 11, 2012 12:51 AM
-
Friday, November 18, 2011 2:42 AM
1 question I have is how many data points are there that need to be transformed
Windows MVP 2010-11, XP, Vista, 7. Expanding into Windows Server 2008 R2, SQL Server, SharePoint, Cloud, Virtualization etc. etc.
Hardcore Games, Legendary is the only Way to Play
Developer | Windows IT | Chess | Economics | Vegan Advocate | PC Reviews

