Is it possible to overlap batched FFTs with CUDA's cuFFT library and cufftPlanMany?

泄露秘密 提交于 2019-12-12 06:04:57

问题


I am trying to parallelize the FFT transforms of an acoustic fingerprinting library known as Chromaprint. It works by "splitting the original audio into many overlapping frames and applying the Fourier transform on them." Chromaprint uses a frame size of 4096, with a 2/3 overlap. For instance, the first frame consists of elements [0...4095], then the second frame is something like [1366.. 5462].

With cufftPlanMany, I know that you can specify batches of size 4096, that will perform batches of [0... 4095], [4096... 8192], etc. Is there some way to make the batched transforms overlap, or should I consider another approach that doesn't use batched execution?


回答1:


If you use Advanced Data Layout, the idist parameter should allow you to set any arbitrary offset between the starting points of 2 successive transform input sets.

For the 1D case, the input will be selected according to the following based on the parameters you pass:

input[ b * idist + x * istride]

(where b is the batch number currently being processed, i.e. b = 0, 1, 2, ... batch size)

"The idist and odist parameters indicate the distance between the first element of two consecutive batches in the input and output data."



来源:https://stackoverflow.com/questions/27719812/is-it-possible-to-overlap-batched-ffts-with-cudas-cufft-library-and-cufftplanma

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!