Note that there are some explanatory texts on larger screens.

plurals
  1. PO1D FFT transform of 2D array in CUDA
    primarykey
    data
    text
    <p>I want to do 1-D FFT of a 2-D array (say along columns only). I am using vs2010/C# with managedcuda.</p> <p>I am having some problems:</p> <ol> <li><p>How to I make a 2-D CudaDeviceVariable? I tried:</p> <pre><code> int n1 = 10; int n2 = 2; int batch = 1; //SizeT test; CudaDeviceVariable&lt;double&gt;[,] datad; datad = new CudaDeviceVariable&lt;double&gt;[n1, n2]; </code></pre></li> </ol> <p>But <code>datad</code> is not a <code>CudaDeviceVariable</code>. Its a normal 2-D array now. So I can't allocate memory in device. Like: </p> <pre><code> double[,] data11 = new double[,] {{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }}; datad.CopyToDevice(data11);//Error?? </code></pre> <p>It is an error because <code>CopyToDevice</code> is not a method for <code>System.Array</code>. If I make <code>datad</code> a <code>n1*n2</code> <code>CudaDeviceVariable</code>, error is still there because <code>CopyToDevice</code> takes <code>double[]</code> as input argument, not <code>[,].</code> Above method works for 1-D arrays. </p> <p>2.is it possible to do 1-D FFT of a large 1-D array. For example, I make 1-D array from <code>data11</code>. And then perform FFT in parts of 10 elements? <code>CudaFFTPlanMany</code> has some options but I am not 100% clear how to use them or how can they be useful to me.</p> <p>Please ask more details if I am not clear. Thanks a lot. </p> <p>EDIT: I got some more details, question still remains, but I made 1-D array of <code>data11</code>, and then performed batched fft, in 2 batches of size 10. It gave me results what I wanted. Syntax is:</p> <pre><code> CudaFFTPlanMany planm; planm = new CudaFFTPlanMany(1, n, 1,cufftType.D2Z); </code></pre> <p>Cheers </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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