How do you use batch mode CUFFT?

I am trying to figure out how to use the batch mode offered in the CUFFT library.

I basically have an image with a width of 5300 pixels and a height of 3500 pixels. Currently, this means that I am running 3500 1D FFT on those 5300 elements using FFTW.

Is this a good candidate problem to run the CUFFT library in batch mode? How to set up data to solve this problem?

thanks

+4
source share
2 answers

Yes, that’s a good problem.

You should go as follows:

  • create an array with the size: sizeof (cufftComplex) * 5300 * 3500 in gpu (here I assume you have complex input)
  • copy your data to gpu
  • create a plan using cufftPlan1d ()
  • execute a plan, for example cufftExecC2C ()

For more information, you should take a look at the CUFFT Handbook.

+2
source

Yes, you can use batch mode.

To use batch mode, items 5300 must be stored continuously.

This means that the distance between neighboring lots is 5300. You can go as follows:

.......... cufftComplex *host; cufftComplex *device; CudaMallocHost((void **)&host,sizeof(cufftComplex)*5300*3500); CudaMalloc((void **)&devcie,sizeof(cufftComplex)*5300*3500); //here add the elements,like this: //host[0-5299] the first batch, host[5300-10599] the second batch ,and up to the 3500th batch. CudaMemcpy(device,host,sizeof(cufftComplex)*5300*3500,......); CufftPlan1d(&device,5300,type,3500); CufftExecC2C(......); ...... 

See the CUFFT Handbook for more information.

+3
source

Source: https://habr.com/ru/post/1342842/


All Articles