Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Batched FFT with varying input distance

henricryden
New User
44 Views

Hi

 

I'm switching my fft implementation from fftw to MKL and I'm having trouble setting up batched FFT's with varying input distance. For instance, lets say I have a float array of size [32, 320, 12], strides [1, 32, 10240] and I want to perform 1D FFT along the second dimension. Then this would be my descriptor:

 

 

DftiCreateDescriptor(&plan, DFTI_SINGLE, DFTI_COMPLEX, 1, 320);
std::vector<MKL_LONG> input_strides(4);
input_strides[0] = 0; // MKL convention
input_strides[1] = 1;
input_strides[2] = 32;
input_strides[3] = 10240;
plan_, DFTI_INPUT_STRIDES, input_strides.data());

 

 

 

The number of transforms (or batches) is 32*12 = 382:

 

 

DftiSetValue(plan, DFTI_NUMBER_OF_TRANSFORMS,  382);

 

 

 

How do I set DFTI_INPUT_DISTANCE (as required when DFTI_NUMBER_OF_TRANSFORMS > 1)?

 

In fftw , you specify the size and strides of all batched dimensions (howmany_dims), but MKL seems to only support a scalar distance?

 

In the example above, the distance varies (12 sub-batches 10240 elements apart, each with 32 FFT's of unit distance 1).

 

Any help is appreciated

0 Kudos
0 Replies
Reply