Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Suggestions for writing a good question:</p> <ul> <li>Post your code in the question, not in an external link. Someday that link will become invalid, and so will your question for future readers. </li> <li>Post your actual data (there isn't that much, in this case) in the question.</li> <li>Post or identify what you would expect the data to be, and why.</li> </ul> <p>Another note:</p> <ul> <li>The cufft documentationn <a href="http://docs.nvidia.com/cuda/cufft/index.html#unique_1292573875" rel="nofollow">instructs you to use cufftComplex</a>, not your own data type, although yours works ok. If the developers of cufft ever change their data layout for some odd reason, your code would break on recompile. If you use the recommended data type, it should not.</li> </ul> <p>Now regarding your question, I ran your code and got results like this:</p> <pre><code>Random H1 0.840188 0.000000 0.394383 0.000000 0.783099 0.000000 0.798440 0.000000 0.911647 0.000000 0.197551 0.000000 0.335223 0.000000 0.768230 0.000000 0.277775 0.000000 0.553970 0.000000 0.477397 0.000000 0.628871 0.000000 0.364784 0.000000 0.513401 0.000000 0.952230 0.000000 0.916195 0.000000 IFFT 13.443005 0.000000 6.310127 -0.000000 12.529589 0.000000 12.775041 0.000000 14.586359 -0.000000 3.160823 0.000000 5.363565 0.000000 12.291674 -0.000000 4.444397 -0.000000 8.863521 0.000000 7.638353 0.000000 10.061934 -0.000000 5.836554 0.000000 8.214415 -0.000000 15.235678 -0.000000 14.659121 -0.000000 </code></pre> <p>The only thing that seems to be missing from your code is that you didn't divide the results by the length of the transform (16 in this case) to get back the original data (as suggested in the sample code <a href="http://docs.nvidia.com/cuda/cufft/index.html#topic_5_1" rel="nofollow">here</a>). When I do that, I get what I believe is expected results:</p> <pre><code>Random H1 0.840188 0.000000 0.394383 0.000000 0.783099 0.000000 0.798440 0.000000 0.911647 0.000000 0.197551 0.000000 0.335223 0.000000 0.768230 0.000000 0.277775 0.000000 0.553970 0.000000 0.477397 0.000000 0.628871 0.000000 0.364784 0.000000 0.513401 0.000000 0.952230 0.000000 0.916195 0.000000 IFFT 0.840188 0.000000 0.394383 -0.000000 0.783099 0.000000 0.798440 0.000000 0.911647 -0.000000 0.197551 0.000000 0.335223 0.000000 0.768230 -0.000000 0.277775 -0.000000 0.553970 0.000000 0.477397 0.000000 0.628871 -0.000000 0.364785 0.000000 0.513401 -0.000000 0.952230 -0.000000 0.916195 -0.000000 </code></pre> <p>By the way, kudos for providing a complete, compilable code sample.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload