Difference between revisions of "FFT Cuda"

From ElphelWiki
Jump to: navigation, search
Line 20: Line 20:
  
 
cudaMemcpy(dstcudaMallocLocation, srchostTiffLocation, counthost, cudaMemcpyHostToDevice)
 
cudaMemcpy(dstcudaMallocLocation, srchostTiffLocation, counthost, cudaMemcpyHostToDevice)
 +
 +
=== How to open a TIFF file? ===
 +
Start with:
 +
* TIFFOpen
 +
* TIFFReadRGBAImage

Revision as of 18:18, 4 November 2010

Input

  • Image is presented in TIFF file structure
  • Array of, FFT of kernels (64x64)

Todo

  • Take a windows 128x128, step by 32 pixels
  • Make a FFT (DFT_2D)
  • Get nth-kernel, pad 32px zero's to each side
  • Multiply FFT with kernel
  • Inverse FFT of the result
  • Save 128x128 window to the n'th position in the TIFF


Knowledge required

CuFFT is modeled after FFTW. To create a new operation we start with cufftPlan2d. The actual operation happens wth cufftExecC2C. cufftExecC2C takes input and output data, respectivily idata and odata in GPU memory.

To use the GPU memory use cudaMalloc.

How to copy from 'CPU' memory to 'GPU' memory?

cudaMemcpy(dstcudaMallocLocation, srchostTiffLocation, counthost, cudaMemcpyHostToDevice)

How to open a TIFF file?

Start with:

  • TIFFOpen
  • TIFFReadRGBAImage